Skip to content

About

Kernel driver POC demonstrating ObRegisterCallbacks handle access stripping, the core mechanism behind anti-cheat process protection.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

kernel-process-protect

Kernel driver demonstrating ObRegisterCallbacks for process handle access stripping, the same core mechanism used by BattlEye, EasyAntiCheat, Vanguard, and FACEIT AC to protect game processes.

What it does

The driver intercepts every usermode OpenProcess / DuplicateHandle targeting Target.exe and strips:

Access Right Hex Effect
PROCESS_VM_READ 0x0010 Blocks ReadProcessMemory
PROCESS_VM_WRITE 0x0020 Blocks WriteProcessMemory
PROCESS_VM_OPERATION 0x0008 Blocks VirtualAllocEx / VirtualProtectEx
PROCESS_TERMINATE 0x0001 Blocks TerminateProcess

Structure

kernel-process-protect/
├── driver/          Kernel driver (ObCallbackDemo.sys)
├── target/          Protected process (Target.exe)
├── verifier/        Tests if protection works (Verifier.exe)
└── README.md

Build

  • driver/: Empty WDM Driver project in Visual Studio + WDK. Requires /integritycheck linker flag and test signing.
  • target/ and verifier/: Console applications. cl.exe /Fe:Target.exe Target.c

Usage

bcdedit /set testsigning on

sc create ObCallbackDemo type=kernel binPath="C:\path\to\ObCallbackDemo.sys"
sc start ObCallbackDemo

Target.exe          (launch from explorer)
Verifier.exe <PID> <address>   (from PowerShell, should fail with Access Denied)

sc stop ObCallbackDemo
sc delete ObCallbackDemo

Limitations

This is a proof of concept. The whitelisted process approach (csrss, explorer, cmd, conhost) is trivially bypassable by injecting into any whitelisted process and opening the handle from there.

Real anti-cheats layer additional defenses on top of ObRegisterCallbacks:

  • Protect whitelisted processes too with additional ObRegisterCallbacks registrations so you can't inject into them
  • Monitor DLL loading via PsSetLoadImageNotifyRoutine to detect injection
  • Monitor thread creation via PsSetCreateThreadNotifyRoutine to catch CreateRemoteThread into whitelisted processes
  • Stack walking on the callback to verify the caller isn't shellcode running inside a legitimate process
  • Boot-time loading (Vanguard) to control the entire chain before anything else runs

These layered defenses are what make the difference between a demo and a production anti-cheat. The arms race between cheat developers and anti-cheat engineers is about stacking and bypassing these layers.

About

Kernel driver POC demonstrating ObRegisterCallbacks handle access stripping, the core mechanism behind anti-cheat process protection.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages