Skip to content

!!IMPORTANT!! Discord server termed, join the new one! discord.gg/QNkCQDWtGD

Sense

Memory Reading in Game Cheats: How External Cheats Read Game Data

How external cheats use ReadProcessMemory, kernel drivers, and pointer chains to read game data without injecting code into the game process.

By SensePublished

Bu yazıyı Türkçe okuyun

How Memory Reading Works in Game Cheats

Memory reading is the foundation of external game cheats. Rather than injecting code into the game process, external cheats read the game's memory from a separate process to extract information like player positions, health values, weapon data, and other game state. This information powers ESP, radar, and other visual cheats.

Understanding how memory reading works is essential to understanding why some cheats are harder to detect than others and how anti-cheat systems defend against external data extraction.

User-Mode Memory Reading

ReadProcessMemory

The simplest memory reading method uses the Windows API function ReadProcessMemory:

  1. The cheat opens a handle to the game process using OpenProcess with PROCESS_VM_READ access.
  2. ReadProcessMemory copies data from the game's virtual address space into the cheat's own memory.
  3. The cheat parses the copied data to extract player positions, health, etc.

This method is straightforward but easily detected because anti-cheats monitor which processes open handles to the game with memory-read access.

Pointer Chains

Game data is not stored at fixed memory addresses. It is stored in dynamically allocated structures that change with each game launch. To find specific data, cheats follow pointer chains:

Base address: The cheat finds the game module's base address (where the .exe is loaded in memory).

Static offsets: From the base address, the cheat adds known offsets to reach a pointer to the game's entity list or player manager.

Dynamic pointers: The cheat follows a chain of pointers through dynamically allocated structures to reach the actual player data:

base + 0x1234 → pointer1
pointer1 + 0x48 → pointer2
pointer2 + 0x100 → player position (x, y, z)

These offset chains are specific to each game version and must be updated after game patches that change the memory layout.

Kernel-Mode Memory Reading

Why Kernel Mode?

Anti-cheats monitor user-mode API calls like OpenProcess and ReadProcessMemory. Kernel-mode reading bypasses these monitored APIs entirely by reading memory at the same privilege level as the anti-cheat's own kernel driver.

Methods

MmCopyVirtualMemory: A kernel function that copies memory between processes without going through the monitored user-mode API path.

Physical memory mapping: The kernel driver maps the target process's physical memory pages into its own address space using functions like MmMapIoSpace or by directly manipulating page tables.

CR3 register manipulation: Each process has a unique CR3 register value (page table base) that maps virtual addresses to physical memory. By temporarily switching CR3, the driver can read another process's memory as if it were its own.

DMA (Direct Memory Access)

The most advanced (and expensive) memory reading method uses external hardware:

A DMA device (typically a PCIe FPGA board) connects to the target computer through a PCIe slot or M.2 adapter. The device reads physical memory directly through the PCIe bus, completely bypassing the CPU and operating system. Since no software runs on the target system, no anti-cheat software can detect the read operation.

What Cheats Read

Entity list: An array or linked list of all game entities (players, objects, projectiles). Each entity contains position, rotation, health, team, and other state data.

Local player: The cheater's own player data, including camera position and rotation needed for world-to-screen calculations.

View matrix: The 4x4 matrix that transforms 3D world coordinates to 2D screen coordinates. Essential for rendering ESP accurately.

Weapon data: Current weapon, ammo count, fire rate, and other weapon-specific values.

Anti-Cheat Defenses

Handle monitoring: Anti-cheats track which processes have open handles to the game and what access rights they have.

Memory encryption: Some anti-cheats encrypt sensitive data structures in memory, requiring cheats to also know the encryption key.

Pointer obfuscation: Encrypting or obfuscating pointer values so that following pointer chains requires additional reverse engineering for each game update.

Kernel-level monitoring: Anti-cheat kernel drivers monitor for suspicious kernel-mode activity, including unauthorized memory copies between processes.

Sense AC's HWID spoofer helps players start fresh after a ban by modifying the hardware identifiers that anti-cheat systems use for ban enforcement.