Hacktricks-skills cheat-engine-reversing
Use Cheat Engine for memory analysis, value scanning, pointer finding, and code injection during game/software reversing. Use this skill whenever the user needs to find where values are stored in memory, modify runtime values, trace what writes to addresses, create persistent pointers, or inject custom code into running processes. Also use for CTF challenges, game analysis, or understanding how programs store and modify data in memory. Make sure to use this skill when the user mentions memory scanning, game hacking, reverse engineering, finding addresses, pointer scanning, or any task involving runtime memory analysis.
git clone https://github.com/abelrguezr/hacktricks-skills
skills/reversing/reversing-tools-basic-methods/cheat-engine/SKILL.MDCheat Engine Reversing Guide
Cheat Engine is a powerful memory scanning and modification tool for analyzing running programs. This guide covers memory scanning, value modification, pointer scanning, and code injection techniques for reversing and CTF work.
Quick Start
- Download from https://www.cheatengine.org/downloads.php
- Complete the built-in tutorial - highly recommended for learning the interface
- Attach to a process - click the computer icon and select the target process
Memory Scanning
Initial Scan
When searching for a value in memory:
-
Select the scan type:
- You know the current valueExact Value
- You don't know the starting valueUnknown initial value
- Value is in a rangeBetween two values
- Track changesIncreased/Decreased value
-
Choose the value type:
(default for integers)4 Bytes
orFloat
for decimal valuesDouble
for text dataString
for custom formatsArray of bytes
-
Optional: Check "Stop game while scanning" for precise timing
Filtering Results
After the initial scan, narrow down candidates:
- Change the value in the target program (e.g., lose health, spend currency)
- Perform a "Next Scan" with the new value or change type
- Repeat until you have a small number of candidates
Pro tip: If you have many results, make the value change multiple times and scan after each change.
Unknown Initial Value
When you don't know the starting value but know how it changes:
- Perform scan with
Unknown initial value - Make the value change in the program
- Select the change type (e.g., "Decreased value" by 1)
- Perform "Next Scan"
- Results show all values modified in that way
Modifying Values
Once you've found the correct address:
- Double-click the address in the list
- Double-click the value field
- Enter the new value
- Check the checkbox to apply the modification
The change is immediately applied to memory. Note: the game may not update the display until it reads the value again.
Finding What Accesses/Writes to an Address
To understand how a value is used:
- Right-click the found address
- Select:
- See all code reading this valueFind out what accesses this address
- See code modifying this value (more specific)Find out what writes to this address
- Play the game and trigger the value change
- The debugger window fills with addresses that modify the value
- Double-click an address to view disassembly
This is essential for understanding game logic and finding injection points.
Pointer Scanning
Memory addresses change between game runs. Pointers provide persistent access.
Finding a Pointer
- Find the value address using normal scanning
- Use
Find out what writes to this address - Double-click a result to open disassembly
- Look for hex values in brackets like
or[edx][eax+1234] - Scan for that hex value as an exact value
- Usually the smallest address is the correct pointer base
Adding a Pointer
- Click
Add Address Manually - Check the
checkboxPointer - Enter the pointer address (e.g.,
)Tutorial-i386.exe+2426B0 - The first address auto-populates from the pointer
- Click OK
Now you can modify the value even after restarting the game, as the pointer resolves to the current memory location.
Pointer Scanner 2 (CE 7.4+)
For more robust pointer finding:
- Use
to reduce false positivesPointers must end with specific offsets - Use the Deviation slider to filter unstable pointers
- After rescan, press
to mark all, thenCtrl+A → Space
to invert and deselect failed addressesCtrl+I - Use
to find resilient base pointersCompare results with other saved pointer map
Code Injection
Inject custom assembly code to modify program behavior.
Using Auto Assembler
- Find the instruction you want to modify
- Click
Show disassembler - Press
to open Auto AssemblerCtrl+A - Select
Template → Code Injection - The address is usually autofilled
Template Structure
[ENABLE] originalcode: ; Original instructions here newmem: ; Your injected code here ; Example: add points instead of subtracting add [life], 2 jmp returnhere originalcode: ; Jump back to original code jmp newmem nop returnhere:
- Click Execute to inject the code
1-byte JMP (CE 7.5+)
For size-constrained routines:
- CE automatically generates a 1-byte JMP stub (0xEB)
- Installs an SEH handler and places INT3 at original location
- Enables "tight" hooks in packed or constrained code
Advanced Features (CE 7.x)
Ultimap 3 - Intel PT Tracing
Record every branch without single-stepping (won't trip most anti-debug):
Memory View → Tools → Ultimap 3 → Check «Intel PT» Select number of buffers → Start
After capture:
Right-click → Save execution list to file
Combine with
Find out what addresses this instruction accesses to locate game-logic hotspots.
DBVM - Kernel-Level Stealth
CE's built-in Type-2 hypervisor (AMD-V/SVM supported):
- Create hardware breakpoints invisible to Ring-3/anti-debug
- Read/write protected kernel memory
- Perform VM-EXIT-less timing-attack bypasses
Note: DBVM won't load with HVCI/Memory-Integrity enabled on Windows 11.
Remote Debugging with ceserver
Attach to Linux, Android, macOS, iOS over TCP:
# On target (arm64) ./ceserver_arm64 & # On analyst workstation adb forward tcp:52736 tcp:52736 # Or use SSH tunnel # In Cheat Engine: Network icon → Host = localhost → Connect
For Frida integration: see
bb33bb/frida-ceserver on GitHub.
Other Notable Tools
- Patch Scanner (MemView → Tools) - Detects unexpected code changes in executable sections
- Structure Dissector 2 - Drag address →
→Ctrl+D
to auto-evaluate C-structuresGuess fields - .NET & Mono Dissector - Improved Unity support; call methods from Lua console
- Big-Endian custom types - Reversed byte order scan/edit for console emulators
- Autosave & tabs for AutoAssembler/Lua windows
OPSEC & Installation Notes
Installation
- Official installer includes ad-offers - always click Decline or compile from source
- AVs flag
as HackTool (expected behavior)cheatengine.exe
Anti-Cheat Evasion
- Modern anti-cheat (EAC/Battleye, ACE-BASE.sys) detects CE's window class even when renamed
- Run in a disposable VM or disable network play
- For user-mode only:
to avoid unsigned driver BSOD on Windows 11 24H2Settings → Extra → Kernel mode debug = off
Common Workflows
Finding and Freezing a Value
- Scan for exact value
- Change value in game, perform next scan
- Repeat until 1-5 candidates remain
- Test each by modifying - correct one affects the game
- Right-click →
to lock the valueFreeze
Creating a Persistent Cheat
- Find the value address
- Use pointer scanning to find the base pointer
- Add as pointer address
- Optionally inject code to modify behavior
- Save the pointer table for future use
Analyzing Game Logic
- Find a value of interest
- Use
Find out what writes to this address - Analyze the disassembly to understand the logic
- Use code injection to modify behavior
- Use Ultimap 3 to trace execution paths
Hotkeys Configuration
Set up hotkeys in
Edit → Settings → Hotkeys:
- Stop game - Useful for precise memory scanning
- Freeze/unfreeze - Quick value locking
- Scan - Rapid iteration
References
- Cheat Engine 7.5 release notes
- frida-ceserver cross-platform bridge
- Complete the built-in Cheat Engine tutorial for hands-on learning