Hello,
I'm here to present my current memory editing project.
This project is a python library for windows, providing the needed functions to start working on your own with memory editing.
This project is released under THE BEER-WARE LICENSE
6):.
Bitbucket repository HERE : srounet / PyMem / source — bitbucket.org
What's have be done :
[+] Listing any process and map each process to the windows structure
[+] Open a Process and enter into debug mod
[+] Read memory from a debugged process
[+] Write memory to a debugged process ( need to work more on that part )
[+] List process Thread
[+] Get main thread from a process
[+] Api Hooking
Next step :
[-] Inject asm into main thread
[-] List process Modules
I will soon publish an online documentation ( with python sphinx ), actually it's documented, but may contains mistakes as I'm french and tried to comment in English.
Code example :
Code:
if __name__ == '__main__':
from process import Process
from memory import Memory
p = Process()
e = p.process_from_name("Wow")
p.open_process_debug(e[0].th32ProcessID)
# at this step we can read and write to the process
m = Memory(p.h_process)
playerBase = m.ReadOffset([0xCF8C50, 0x34, 0x24], 'uint')
hp = m.ReadOffset([playerBase + 0x08, (0x17 * 4)], 'uint')
player_x = m.ReadOffset(playerBase + 0x798, 'float')
Hook exemple: ' OpenProcess '
Code:
def OpenProcess_in(dbg, args):
print "OpenProcess_in"
return 0x00010002
h = Hook()
if h.attach(6412):# process id
if h.address_dll("OpenProcess", "kernel32.dll"):
if h.register('OpenProcess', h.get_address('OpenProcess'), 2, OpenProcess_in):
print "[+] Hooks set, continuing process"
h.run()
As you can see it's soooo simple.
I will update this thread as soon as i get more time to implement new functionalities.
Feel free to flame, comment, troll :=)
This project is currently in a development process so any suggestion is available.