1

I need to be able to read a specific value from memory in Python. Basically, I need to create an application that will read a variable from other program and react to it. I need it only for simplifying our workflow, so no cheating in games ;). Using Cheat engine, I found the adress of the variable taht we need to read - "93C28D70" in our situation (I know this is going to change when I restart it, but it is worth it).

Is it possible to read a memory address from another application? If so, how?

Foreen
  • 369
  • 2
  • 17
  • 1
    This won't be easy, because operating systems usually prevent one process accessing another process' memory, because otherwise you could not trust any software doing what it is supposed to do. – Feodoran Jun 29 '20 at 15:54
  • This is not entirely true. Assuming you can open a PROCESS_VM_READ handle to the program (which should be possible assuming you have at minimum the same level of rights and the program is not actively defending against that), you can use functions such as https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory – オンディ Aug 30 '22 at 05:37

1 Answers1

0

Look into libraries such as Pymem; there are other options as well.

If the value of your program is in static memory, you can calculate the offset of it to the module base of the module it is a part of. That allows you to have the address of it across restarts.

If it is in dynamic memory it becomes a bit more complicated, however you can use CheatEngines pointer scan or pattern scan for it. (Again, there are other options as well)