pythoncheat-engine

Trouble with ReadWriteMemory module in python to read 64bit process memory


im trying to get x coordination for a game called herosiege for learning (its not for hacking) the result returns 0 and i dont know where im missing i tried to look it up and someone said i need to put baseaddress of the game in process.get_pointer like

x_pointer = process.get_pointer((baseaddress of the game) + 0x06D26780, 
offsets=[0xE8, 0x10, 0x170, 0x08, 0x08, 0x20, 0x28])

but the base adress using this code gets me some some weird number(140698825785344) and i dont even know how to put this to my code. does anyone know how to solve this problem?

to get base address

import win32process
import win32api

# first get pid, see the 32-bit solution

my_pid = 13632

PROCESS_ALL_ACCESS = 0x1F0FFF
processHandle = win32api.OpenProcess(PROCESS_ALL_ACCESS, False, my_pid)
modules = win32process.EnumProcessModules(processHandle)
processHandle.close()
base_addr = modules[0] 
print (base_addr)

for reading memories in python

from ReadWriteMemory import ReadWriteMemory

rwm = ReadWriteMemory()

process = rwm.get_process_by_name('Hero_Siege.exe')
process.open()
(process)



x_pointer = process.get_pointer(0x06D26780, offsets=[0xE8, 0x10, 0x170, 0x08, 0x08, 0x20, 0x28])
x_coord = process.read(x_pointer)
print(x_coord)

enter image description here


Solution

  • You just have to change all the offsets so it reads from bottom to top in the array you give. So it should be:

    offsets=[0x28, 0x20, 0x8,0x8,0x170,0x10,0xE8]