Practice library / Exploit development and reversing
Lab · Easy · 1.5 hours
Game Hacking Fundamentals
Memory scanning, value freezing, pointers, and basic code patching against a running game.
On this page 7 sections
Game hacking is memory manipulation on a live process. A scanner finds the address of a value like a health counter, a freezer locks it, and a pointer chain survives restarts by tracking the real object base. Security engineers meet the same ideas in anti-cheat bypasses and in live malware analysis, where a binary edits another process at runtime. In this lab you scan a running game, freeze values, follow a pointer chain, and patch a single instruction to change behaviour.
What You'll Learn
- Scan a running process for a known value and narrow results with successive scans
- Freeze a value so the game cannot change it
- Follow a pointer chain to find the base address of a game object
- Locate the assembly instruction that modifies a value
- Patch a single instruction to change game behaviour permanently
- Explain why these techniques are the foundation of reverse engineering
Lab Setup
You work against the Cheat Engine Tutorial — a small practice game that ships with Cheat Engine. It is designed to be hacked.
| Item | Requirement |
|---|---|
| Lab machine | Windows 10 or 11 (a VM is fine) |
| Cheat Engine | Version 7.5+. Download from the official site and install it |
| Target | The Cheat Engine Tutorial (Tutorial-x86_64.exe), included with the install |
Launch the tutorial from the Cheat Engine folder. It opens a window with numbered steps. Each step teaches one skill. This lab follows the same progression.
Authorised scope only. Isolated lab network. Never on production.
Cheat Engine is a legitimate reverse engineering tool. Use it only on software you own or on practice targets like this tutorial. Never attach it to a live online game — most anti-cheat systems ban you on sight.
Step 1: Attach to the process and scan for a value
Attach and scan
Every memory hack starts the same way: attach a tool to the running process and search for the value you want to change. The first scan usually returns thousands of results. Successive scans narrow it down.
Open Cheat Engine. Click the flashing computer icon in the top left to open the process list.
Select Tutorial-x86_64.exe and click Open.
The tutorial shows Step 2: exact value scan. It displays a health bar and a number, for
example 95. Type 95 into the Value box in Cheat Engine. Leave the scan type as
Exact Value and the value type as 4 Bytes. Click First Scan.
Found: 48 addressesDozens of addresses hold the value 95 right now. Click Hit me in the tutorial window.
The health changes, for example to 72. Type 72 in the value box and click Next Scan.
Found: 1 addressOne address survived both scans. That is the health variable. Double-click it to add it to the address list at the bottom.
The key insight: a value that changes in the game also changes in memory. By scanning for the old value and then the new value, you filter out every address that happened to match the first time.
Step 2: Change and freeze a value
Once you have the address, you can write any number to it. Freezing keeps your value even when the game tries to overwrite it.
In the address list at the bottom, double-click the Value column of the health entry.
Type 1000 and press Enter. The tutorial should recognise the change and advance to the next
step.
Now try freezing. The tutorial's Step 3 shows two values: health and ammo. Find both with the scan technique from Step 1 (scan, change, rescan). Add both to the address list. Click the Active checkbox next to each entry. Cheat Engine now writes your value back many times per second.
Address Type Value Active
0x01A3F4C0 4 Bytes 1000 ✓ (frozen)
0x01A3F4C8 4 Bytes 500 ✓ (frozen)Click Hit me repeatedly. The values flash but always snap back. The game writes a lower number, and Cheat Engine immediately overwrites it with yours. This is a freeze — also called a lock in other tools.
Freezing is brute force. The game still runs its damage code; your tool just wins the race. A cleaner approach is patching the code that does the damage, which you learn in Step 4.
Step 3: Follow a pointer
When you restart the game, the address of the health variable changes. A pointer is a stable address that always points to the variable, even after a restart. Finding the pointer makes your cheat survive a relaunch.
The tutorial's Step 6 asks you to find a pointer. The value is a 4-byte integer. Scan for
it and find the address (for example 0x0256A530).
Right-click the address in Cheat Engine and choose Find out what writes to this address. A debugger window opens. Click Hit me in the tutorial. An instruction appears.
mov [rsi+18], eax Count: 1This tells you the game accesses the value through the register rsi plus an offset of 0x18.
Click the instruction and read the detail panel.
The value of the pointer needed to find this address is probably 0256A518.
RSI = 0256A5180x0256A518 is the base of the object. The health is at offset +0x18. Now search for that
base address: scan for 0256A518 as an 8-byte value. You find it at a stable address like
0x00100578.
Add a pointer entry in Cheat Engine: click Add Address Manually, tick Pointer, enter
0x00100578 as the base, and 18 as the offset. The entry shows the current health value.
Restart the tutorial. The pointer entry still shows the correct value because the base address
did not change.
P-> 0x00100578 -> +18 Value: 100Pointer chains can be deeper — a pointer to a pointer to a pointer. Each level adds an offset. The tutorial's later steps practise multi-level pointers.
Step 4: Find and patch code
Instead of overwriting a value every frame, you can change the instruction that modifies it. A single NOP replaces the damage code. This is cleaner and faster than a freeze.
The tutorial's Step 5 asks you to change the code. Find the health address as before. Right-click it and choose Find out what writes to this address. Click Hit me. The instruction that decreases health appears.
sub [rsi+780], edx Count: 1This is the damage instruction. sub subtracts edx (the damage amount) from the health. To
stop all damage, replace it with NOP (no operation) bytes. Click the instruction and choose
Replace with code that does nothing (NOP).
Original: 29 96 80 07 00 00 sub [rsi+780], edx
Replaced: 90 90 90 90 90 90 nop nop nop nop nop nopClick Hit me in the tutorial. The health does not decrease. The game runs normally, but the subtract instruction is gone. The tutorial recognises the change and advances.
This is a code patch. You changed one instruction in the running process. The effect is instant and permanent for this session. The game never writes a lower value because the code that does so no longer exists.
Defence and Detection
Anti-cheat systems defend against every technique in this lab. They detect debuggers by
checking IsDebuggerPresent and NtQueryInformationProcess. They scan for known tools like
Cheat Engine by window title and process name. Integrity checks compute a hash of the code
section and crash if it has changed, which catches NOP patches. Encrypting values in memory
(storing health XOR key instead of health) defeats simple scans because the searcher does
not know the plaintext.
Server-authoritative design is the strongest defence. The server owns the real health value. The client only displays it. A memory edit on the client changes the display, not the truth. Most competitive online games use this model.
Check Your Work
- Why does the first scan return many addresses, but a rescan after a value change returns one?
Answer
Many memory locations happen to hold the same number. After the game changes the health, only the real health address holds the new value. The others still hold the old number and are filtered out.- What is the difference between freezing a value and NOPing the instruction that changes it?
Answer
Freezing repeatedly writes your value back — the game's code still runs and the value flickers. NOPing removes the instruction entirely, so the game never writes a new value. NOPing is cleaner and uses no background thread.- A pointer entry shows
P-> 0x00100578 -> +18. What do the base and the offset mean?
Answer
The base `0x00100578` is a stable address that holds a pointer to the game object. The offset `+18` is the distance from the start of that object to the health field. Together they always find the value, even after a restart.- Why do online games keep the real health value on the server, not the client?
Answer
The server is outside the player's control. A memory edit on the client can only change the local copy. The server rejects impossible values and sends corrections, so the cheat has no effect on the real game state.Sign in to track progress and send feedback.