Skip to content

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

Sense

Process Hollowing in Game Cheats: How Cheaters Hide Code in Legitimate Processes

How process hollowing works to disguise cheat code as a legitimate Windows process, the technical steps involved, and how anti-cheats detect it.

By SensePublished

Bu yazıyı Türkçe okuyun

What Is Process Hollowing?

Process hollowing is a code injection technique where a legitimate Windows process is started in a suspended state, its executable code is replaced with malicious or unauthorized code, and then the process is resumed. The result is cheat code running inside what appears to be a trusted system process, making it harder for anti-cheat systems to identify.

In the context of game cheating, process hollowing is used to run cheat loaders and injectors disguised as legitimate programs like svchost.exe, notepad.exe, or explorer.exe. When an anti-cheat scans running processes, it sees trusted Windows executables rather than obvious cheat tools.

How Process Hollowing Works

Step 1: Create Suspended Process

The technique begins by creating a new instance of a legitimate Windows executable in a suspended state:

CreateProcess("C:\Windows\System32\notepad.exe", ..., CREATE_SUSPENDED, ...)

The CREATE_SUSPENDED flag causes the process to be created but not yet executed. The main thread exists but is frozen before executing any code.

Step 2: Unmap the Original Image

The legitimate executable's code is removed from the process's memory:

NtUnmapViewOfSection(processHandle, imageBaseAddress)

This removes the original code and data sections of notepad.exe from the process's address space, leaving an empty shell.

Step 3: Allocate New Memory

Memory is allocated at the original image base address (or a new address) to hold the replacement code:

VirtualAllocEx(processHandle, imageBase, imageSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)

Step 4: Write Replacement Code

The cheat code (compiled as a PE executable) is written into the allocated memory:

WriteProcessMemory(processHandle, imageBase, cheatImage, imageSize, ...)

The PE headers, code sections, data sections, and import tables are all written to match the layout expected by the Windows loader.

Step 5: Fix the Entry Point

The suspended thread's context is modified to point to the new code's entry point:

GetThreadContext(threadHandle, &context)
context.Eax = newEntryPoint  // For 32-bit, Rcx for 64-bit
SetThreadContext(threadHandle, &context)

The PEB (Process Environment Block) is also updated to reflect the new image base address.

Step 6: Resume Execution

ResumeThread(threadHandle)

The process now executes the cheat code while still appearing as notepad.exe in Task Manager, Process Explorer, and anti-cheat process lists.

Why Cheaters Use Process Hollowing

Process trust: Anti-cheat systems maintain whitelists of trusted Windows processes. A hollowed svchost.exe passes basic process name checks.

Stealth: Process hollowing avoids creating new processes with suspicious names. The cheat runs inside an existing, trusted process.

Anti-analysis: Reverse engineering the cheat is harder when it is disguised as a system process. Memory dumps may appear to contain legitimate system code.

How Anti-Cheats Detect Process Hollowing

Modern anti-cheats have developed several methods to detect hollowed processes:

Image verification: The anti-cheat compares the in-memory image of a process against the expected content of its executable file on disk. If notepad.exe is running but its memory does not match the notepad.exe file, it has been hollowed.

PEB verification: The PEB contains the image base address and other metadata. Discrepancies between PEB data and actual memory layout indicate hollowing.

Thread start address verification: Checking whether the main thread's start address points to code within the expected module.

Memory attribute monitoring: Hollowed processes often have memory regions with PAGE_EXECUTE_READWRITE permissions, which is unusual for legitimate system processes.

ETW (Event Tracing for Windows): Kernel-level event tracing can detect the sequence of API calls characteristic of process hollowing: CreateProcess with CREATE_SUSPENDED, NtUnmapViewOfSection, VirtualAllocEx, WriteProcessMemory, ResumeThread.

Consequences

Detection of process hollowing techniques results in immediate permanent bans with hardware identification. Sense AC's HWID spoofer changes the hardware identifiers that anti-cheat systems read, allowing a new account on the same hardware after a ban.