Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

What steps usually takes or modify a trainer?

How a trainer can change the way a game behaves?

Edit: with the word trainer I mean the applications, usually a single executable, that can unlock and give extra points and features during a gameplay, kind of a series of cheats that you can activate with this executable.

share|improve this question
1  
Could you clarify what you mean by "trainer"? –  doppelgreener Aug 18 '12 at 5:45
    
@JonathanHobbs i have added more to the question. –  user827992 Aug 18 '12 at 5:49
    
Are you talking about hacking and cheating tools? Or something like Game Shark and such (which, admittedly, is just a hacking tool for console games)? –  Nicol Bolas Aug 18 '12 at 7:12
1  
@NicolBolas the hacker/underground part :) –  user827992 Aug 18 '12 at 7:14

1 Answer 1

up vote 3 down vote accepted

I've never written a trainer myself, but I would guess that they operate by editing specific locations in the game's memory. Access to the game's address space can be gained by DLL injection or by using a debugger-style API like WriteProcessMemory.

To alter specific aspects of the running game (health, points, resources etc.) you have to figure out exactly where in the game's memory this data is stored. In practice, the location of this data probably varies from one session to the next (due to nondeterministic heap allocations, etc.), so really you have to figure out how to find that data starting from a reliable address (such as a global variable in the data section of the game's .exe) and following pointers, etc. This is the hard part.

Once you know where the data is, you just overwrite it with your desired value.

share|improve this answer
    
this is the horror for a programmer, i was assuming that each process has a separate memory space for doing its own things, i found incredible that you can hack an application and a process so easily, it's stunning ... –  user827992 Aug 18 '12 at 7:27
    
@user827992 Each process does have a separate memory space; that's why you have to use some special tricks like I mentioned to get access to the game's memory. However, if the game developers want to try to stop you they have some options available to counter these methods, as well. It's an arms race. (Ultimately, if you're running on the hacker's computer then the hacker wins. The game developers can make it difficult for the hacker to win, though.) –  Nathan Reed Aug 18 '12 at 7:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.