Is there a good and easy to use module built into Python for editing memory?

Is there a good and easy to use module built into Python for editing memory? Or is there any module at all?

What I'm looking for is a way to bind to a process and read / write to it. How Cheat Engine Works Here is an example of how it works in C ++ .

+4
source share
1 answer

It's time to find a way to do this, but here's what I came up with!

from ctypes import * from ctypes.wintypes import * pid = 0 #the pid of the process, aquired earlier by hand address = 0x0000 #where to read from while in the memory OpenProcess = windll.kernel32.OpenProcess ReadProcessMemory = windll.kernel32.ReadProcessMemory CloseHandle = windll.kernel32.CloseHandle PROCESS_ALL_ACCESS = 0x1F0FFF datadummy = b'.'*200 buffer = c_char_p(datadummy) bufferSize = len(buffer.value) bytesRead = c_ulong(0) processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, int(PID)) ReadProcessMemory(processHandle, address, buffer, bufferSize, byref(bytesRead)) CloseHandle(processHandle) 

And to write to memory, I would just add WriteProcessMemory = windll.kernel32.WriteProcessMemory and then call it

+5
source

All Articles