top of page

Introduction to cheat engine: Basic variable alteration

Cheat engine is a debugger with a non-traditional UI. It is mostly used to cheat at video games, and can be used even without any programming knowledge. It provides a great tutorial on how to approach manipulating video games, with minimal technical jargon. This blog however, will try to explain some of the technicalities abstracted away by cheat engine.

Lets start off with debugging a very basic application. The first step in manipulating a process is to isolate the data you are looking for. We do this by changing the data in predictable ways and scanning the process memory to see which memory locations reflect these changes. Here's a practical example

Create a basic program consisting of the following code.

We have an integer "value" which we can increment by pressing 'l', and can print with 'p'.

Run this program, and start up cheat engine. Here's what its UI looks like

Cheat Engine UI

Open your process in cheat engine by clicking the monitor icon in the top left and selecting your program.

Now go back to the console window for your program and press 'l' a few times, then press 'p' to print the value (I pressed it thrice).

Go back to cheat engine and scan for this value you just printed out. Enter the value in the "Value" field and press "New Scan"

You will end up with a bunch of memory addresses. Now go back to your console window, increment the value a few times, and print it.

Return to cheat engine and scan for this new value. Enter the new value in the "Value" field and press next scan. Cheat engine will check the list of initial memory addresses it had acquired and only retain those which match the new value. This is how we zero in on the variable we are looking for. I ended up with only one address, if you end up with more, rinse and repeat till you only have one.

Double click the address to begin tracking it. It will be moved to the memory table which forms the bottom half of the cheat engine UI.

You are now free to modify this value. Double click the "Value" column of the value and change it to whatever you like. Go back to your console window and print the value of your variable. You will see the value you had cheat engine write to your program.

Pressing 'l' will increment the value once again ( to 323 in my case). Cheat engine lets you freeze these values so that they remain fixed at whatever you choose. Click the box under the "Active" column to freeze your value. Pressing 'l' now should have no effect on it, the printed value will always be the same.

Cheat engine uses the windows system functions ReadProcessMemory and WriteProcessMemory to preform these scans and overwrite data. This process is the crux of using cheat engine, but is quite weak if used in isolation. I will talk about why in the next post .


Komentarze


bottom of page