pymem.exception.memoryreaderror cant read memory

Viewed 6

Im trying to read float value of an address and it gives me an error it says error could not read memory

from pymem import *
from pymem.process import *
import keyboard

mem = Pymem("game.exe")
module = module_from_name(mem.process_handle, "game.exe").lpBaseOfDll

def getPointerAddr(base, offsets):
    addr = mem.read_int(base)
    for offset in offsets:
        if offset != offsets[-1]:
            addr = mem.read_int(addr + offset)
    addr = addr + offsets[-1]
    return addr
northsouth = getPointerAddr(module + 0x01B20C50, [0x38, 0x60, 0x290, 0x68, 0x140, 0x0, 0x3C])
print(mem.read_float(northsouth))


Traceback (most recent call last):
  File "c:\Users\user\Desktop\python applet\rfgvedv.py", line 15, in <module>
    northsouth = getPointerAddr(module + 0x01B20C50, [0x38, 0x60, 0x290, 0x68, 0x140, 0x0, 0x3C])
  File "c:\Users\user\Desktop\python applet\rfgvedv.py", line 12, in getPointerAddr
    addr = mem.read_int(addr + offset)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pymem\__init__.py", line 532, in read_int
    raise pymem.exception.MemoryReadError(address, struct.calcsize('i'), e.error_code)
pymem.exception.MemoryReadError: Could not read memory at: 565079368, length: 4 - GetLastError: 299
0 Answers
Related