2
\$\begingroup\$

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.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Could you clarify what you mean by "trainer"? \$\endgroup\$ Commented Aug 18, 2012 at 5:45
  • \$\begingroup\$ @JonathanHobbs i have added more to the question. \$\endgroup\$ Commented Aug 18, 2012 at 5:49
  • \$\begingroup\$ 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)? \$\endgroup\$ Commented Aug 18, 2012 at 7:12
  • 1
    \$\begingroup\$ @NicolBolas the hacker/underground part :) \$\endgroup\$ Commented Aug 18, 2012 at 7:14

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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 ... \$\endgroup\$ Commented Aug 18, 2012 at 7:27
  • \$\begingroup\$ @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.) \$\endgroup\$ Commented Aug 18, 2012 at 7:46

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.