Architecture Overview

CS2-Extern runs as a separate process and reads game memory externally through either user-mode APIs or through a minimal kernel driver. The architecture is modular with clear separation between rendering, game analysis, and memory access layers.

Memory Backends

The cheat supports two memory access methods that can be swapped at runtime:

The shared memory approach avoids creating a device object or symbolic link, making the driver's presence harder to enumerate from user-mode.

Overlay Rendering

The overlay is a transparent, click-through window positioned over CS2 using SetWindowPos to track the game window. Rendering uses DirectX 11 with:

Pattern Scanning for Offsets

CS2 updates frequently break hardcoded offsets. The solution is runtime pattern scanning that finds signatures in the game binary and calculates offsets dynamically.

// Pattern format: bytes + wildcards (??)
// Example: "48 8B 05 ?? ?? ?? ?? 48 85 C0"
pattern scanner:
  1. Read game module into buffer
  2. Scan for byte pattern with wildcards
  3. Resolve relative addresses (RIP-relative on x64)
  4. Return calculated pointer

What the patterns find

Combat Features

Aimbot

The aimbot calculates target angles based on enemy bone positions and smooths the mouse movement to appear human-like:

Triggerbot

Monitors crosshair position and fires when an enemy intersects. Includes hitchance calculation and delay randomization to avoid detection patterns.

Stealth Considerations

External cheats have different detection vectors than internal ones:

What I Learned

Building CS2-Extern taught me about Windows graphics APIs, process memory layout, and the arms race between cheat developers and anti-cheat. The most valuable insight was understanding how kernel drivers can provide stealthier memory access while remaining minimal in functionality.

Architecture Decisions

External vs Internal: External is safer to develop (no DLL injection) but limited in capabilities. The kernel driver bridge attempts to get the best of both: external's safety with internal's memory access stealth.

DirectX vs GDI: DirectX 11 provides better performance and alpha blending for the overlay. GDI is simpler but slower and more obvious.