Until this is done, you can use ctypes to access these functions. I've written a little game-cheat program in Python that does exactly that, and it includes a module that wraps ReadProcessMemory and friends in a nice Process class.
Here's a stripped-down version of the key functions:
You can also use win32api for most of the work and only use ctypes for the missing functions. For example, if you used the win32api.OpenProcess function, h would be a PyHANDLE, so you'd have to pass self.h.handle to ReadProcessMemory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=543879
I guess also WriteProcessMemory would also be helpful.
I notice these functions are in the perl equivalent.
Logged In: YES
user_id=1473180
Originator: NO
Until this is done, you can use ctypes to access these functions. I've written a little game-cheat program in Python that does exactly that, and it includes a module that wraps ReadProcessMemory and friends in a nice Process class.
Here's a stripped-down version of the key functions:
import ctypes
kernel = ctypes.windll.kernel32
class Process(object):
def __init__(self, pid):
self.pid = pid
self.h = kernel.OpenProcess(0x0018, 0, pid)
def close(self):
if (self.h):
kernel.CloseHandle(self.h)
self.h = None
def __del__(self):
self.close()
def read(self, addr, size):
buf = ctypes.create_string_buffer(size)
bytesread = ctypes.c_size_t()
kernel.ReadProcessMemory(self.h, addr, buf,
ctypes.c_size_t(size),
ctypes.addressof(bytesread))
return buf[:bytesread.value]
You can also use win32api for most of the work and only use ctypes for the missing functions. For example, if you used the win32api.OpenProcess function, h would be a PyHANDLE, so you'd have to pass self.h.handle to ReadProcessMemory.
Logged In: YES
user_id=2153795
Originator: NO
Yes, that would be great !
And of course other process manipulation APIs like OpenProcess etc would be great !