PyMem - Python process memory editing menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    nopz's Avatar Active Member
    Reputation
    67
    Join Date
    Aug 2009
    Posts
    56
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    [Python 2.5.4] PyMem - Python process memory editing

    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.
    Last edited by nopz; 03-25-2010 at 03:56 AM. Reason: Changed topic
    My blog: https://pimpmykitty.wordpress.com
    PyFasm: https://github.com/srounet/pyfasm
    Pymem: https://github.com/srounet/pymem

    PyMem - Python process memory editing
  2. #2
    nopz's Avatar Active Member
    Reputation
    67
    Join Date
    Aug 2009
    Posts
    56
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    .reserved for changelog

    - 05/03/2010: Moved project to HG repos : http://bitbucket.org/srounet/pymem/src/
    - 07/03/2010: Added Threading functionalities
    Last edited by nopz; 03-07-2010 at 01:58 PM.
    My blog: https://pimpmykitty.wordpress.com
    PyFasm: https://github.com/srounet/pyfasm
    Pymem: https://github.com/srounet/pymem

  3. #3
    Sednogmah's Avatar Contributor
    Reputation
    129
    Join Date
    Oct 2009
    Posts
    158
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even though I have no use for it because I'm not using Windows, a Python library is always nice to see. The language is a good choice for implementing higher level logic too, because of its relaxed semantics. I bet an elegant object manager can be easily designed, thanks to Python's functional programming idioms and of course duck typing.

    You should consider asking a mod to move this thread to the memory editing section because it doesn't quite fit in the "Server-side programming" section.

    Anyhow, good luck with your project!
    Last edited by Sednogmah; 03-05-2010 at 05:44 AM.
    951388dcb8e5be825c2c10a7f53c16fcd84fc6c8b76ff0483237eeff745eaeac

  4. #4
    wancharle's Avatar Private
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Congratulations initiative
    It's just so annoying to program in C, now because of your initiative will be much easier to make my project (wow translated into Portuguese).

  5. #5
    daphtpunk's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    C programming is so complex.

  6. #6
    nopz's Avatar Active Member
    Reputation
    67
    Join Date
    Aug 2009
    Posts
    56
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's just so annoying to program in C, now because of your initiative will be much easier to make my project (wow translated into Portuguese).
    Just answering here to your Bitbucket question:
    I'm going to release a way to interact with memory strings, but for the strings research part, i think for your needs, it has to be pattern oriented, in order to work across releases. What you want to do is quite complicated and requires a lot of work in my opinion. ( Ie : translating the game client into an other language ). And i wish you good luck in that project.

    Well, I'm going to work on the project this week-end, maybe tonight if I'm not too tired.
    Just going to clean the PyDbg code part a bit, and add new public accessors for the Hooking part.

    I need to work on the Memory writing part, and make some test in order to provide a full functional library.

    If you have any suggestions, it will be a pleasure to implements new functionalities.
    My blog: https://pimpmykitty.wordpress.com
    PyFasm: https://github.com/srounet/pyfasm
    Pymem: https://github.com/srounet/pymem

Similar Threads

  1. [Release] [Release][Python]Pymem - Python memory library
    By nopz in forum WoW Memory Editing
    Replies: 7
    Last Post: 05-28-2021, 11:05 AM
  2. PyMem Memory Editing Example[VIDEO]
    By nurik040404 in forum Programming
    Replies: 0
    Last Post: 01-09-2016, 04:50 AM
  3. In Process vs. Out of Process memory editing
    By motodrizzle in forum Programming
    Replies: 2
    Last Post: 07-16-2013, 08:23 AM
  4. PyMem - Python process memory editing
    By nopz in forum WoW Memory Editing
    Replies: 5
    Last Post: 05-09-2010, 05:01 AM
  5. [Help] Memory editing a process, wow wont show...
    By Motivation69 in forum WoW Memory Editing
    Replies: 1
    Last Post: 03-04-2009, 07:04 PM
All times are GMT -5. The time now is 09:42 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search