Home > Blockchain >  <class 'OverflowError'>: int too long to convert
<class 'OverflowError'>: int too long to convert

Time:09-17

Im trying to read memory of a program but I get error it says

from ReadWriteMemory import ReadWriteMemory

rwm = ReadWriteMemory()

process = rwm.get_process_by_name("Tutorial-x86_64.exe")
process.open()

baseaddress = 0x100000000 0x00325A70

pointer = process.get_pointer(baseaddress, offsets = [0x598, 0x28, 0x8, 0xF8, 0x18, 0x18, 0x7F8])
print(process.read(pointer))
Traceback (most recent call last):
  File "C:\Users\user\Desktop\program\from ReadWriteMemory import ReadWriteMem.py", line 10, in <module>
    pointer = process.get_pointer(baseaddress, offsets = [0x598, 0x28, 0x8, 0xF8, 0x18, 0x18, 0x7F8])
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\ReadWriteMemory\__init__.py", line 77, in get_pointer
    temp_address = self.read(lp_base_address)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\ReadWriteMemory\__init__.py", line 100, in read
    ctypes.windll.kernel32.ReadProcessMemory(self.handle, lp_base_address, lp_buffer,
ctypes.ArgumentError: argument 2: <class 'OverflowError'>: int too long to convert

CodePudding user response:

Your version of ReadWriteMemory is too old. This was fixed in September of 2020. You might try pip install --upgrade ReadWriteMemory. If that doesn't bring in the latest, then you'll need to edit the package, to apply the two changes to __init__.py shown in this patch to add ctypes.c_void_p(...).

https://github.com/vsantiago113/ReadWriteMemory/commit/e8b2859349e41380b561f6115ee43f058323877a

  • Related