Search code examples
c++variablesmemorylocationdata-extraction

Acess variable from another program c++


I want to create program that reads my HP in a game and automatically ask for heal when HP was below a certain amount. For that i need to read the HP variable in the game, it's an online game, Urban Terror more specifically, but i just need to check HP amount and not change it. I believe it's possible to extract the location of the memory with cheat engine.


Solution

  • I recommend you choose other projects to improve your C++ and programming knowledge.

    You will need to know:
    1) How to have the Game program generate an event when the HP change.
    2) Find out where in memory the HP are stored.
    3) Find out when the HP are valid. For example, the HP could be stored on the stack and only valid for a given duration.
    4) Research your operating system to find out how to detect when a memory location changes, it may not have any API for this.
    5) Write a program that is constantly polling the HP memory location to detect a change, then activate an event when the change occurs. You should research on the frequency that is needed for polling.