How does memory manipulation works for cheats?, how does one create it, i think it must be something to do with your RAM and changed it to give a different value, but how to create it?

  • 2
    \$\begingroup\$ I suggest reading stuff about Cheat Engine. It has even a tutorial describing how simple memory edits can be done especially with multi-level pointers. I am using it for example to reverse engineer structs from the memory. Just keep in mind you can't make your game 100% secure against attacks - there will always be a way to hack the game if someone is eager to do so. Just depends how difficult it is and if it is reasonable to put time and effort into anti-cheating mechanics. \$\endgroup\$ – Christian Ivicevic Dec 6 '15 at 14:36

In windows if you can get a HINSTANCE to the game process with access right of PROCESS_VM_WRITE or PROCESS_VM_OPERATION then you can use WriteProcessMemory to write arbitrary values into arbitrary locations of the game's virtual memory.

Otherwise you can attach to the process as a debugger and that will also let you stop the threads of the game to avoid race conditions.

Figuring out where to write what to is up to the designer of the cheat engine to reverse engineer.

| improve this answer | |
  • \$\begingroup\$ Wouldn't that make the game Windows exclusive though, if you used a Windows specific API? \$\endgroup\$ – Lolums Dec 6 '15 at 14:56
  • \$\begingroup\$ @Lolums cheat engines will generally be coded platform specific. Though you can do similar things on linux. \$\endgroup\$ – ratchet freak Dec 6 '15 at 14:59
  • \$\begingroup\$ True but if touching platform specific APIs, one should always support all three platforms. \$\endgroup\$ – Lolums Dec 6 '15 at 15:03
  • \$\begingroup\$ Edit, just realised that I mistook the question for something else. Yeah, this is a correct answer. \$\endgroup\$ – Lolums Dec 6 '15 at 20:07

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