WriteProcessMemory, ReadProcessMemory and Key Capture
Posted on 1999-07-19
I am trying to figure out how to make 'Trainers' for games.
This is where you push a button, say F12 and it will modify the health to 100, then it will keep it on 100 by using a timer to read the memory, check if its 100, if not then change it back to 100 again.
I know the API calls for changing the memory are WriteProcessMemory and ReadProcessMemory but I have no idea how to use these, or even how to declare them.
Also I need to know how to capture key presses when the trainer isn't the active program, specifically the F1-F12 keys.
The only way I will have of finding the program is the location of the exe file, and the text in the tasklist (CTRL-ALT-DEL), so if I need a process ID, the code needs to work that out.
If someone can give me some sample code for all of this, 150 points are coming your way :)
Please please please help..
I already know how to find the memory location using Softice, so thats not a problem.