expert

Kernel Patch Protection (PatchGuard) & HyperGuard

Periodic, obfuscated integrity checks that bugcheck the machine if core kernel state has been tampered with.

What you should already know

This topic is marked expert. Skim these first if any of them feel unfamiliar.

Related labs

Hands-on exercises for this area — in the browser or on a Windows machine.

View all labs

Guided paths in this branch

Follow a short sequence step by step. Each path links to the first topic; use Read next on each page to continue.

Why it matters

Every other security mechanism in this course trusts that the kernel itself hasn't been modified by a driver. PatchGuard (and its hypervisor-enforced successor HyperGuard) is specifically what makes that assumption hold on 64-bit Windows, by making kernel tampering detectable and fatal rather than silently possible.

Mental model

Think of it as an alarm system that doesn't tell you it's watching: rather than blocking a write to protected kernel structures up front, it periodically (and at unpredictable intervals, from deliberately obfuscated, self-checking code scattered through the kernel) re-verifies that nothing it cares about has changed — and if something has, it bugchecks the system (`0x109: CRITICAL_STRUCTURE_CORRUPTION`) instead of allowing a machine with a tampered kernel to keep running.

How it works

  1. 1PatchGuard (`KPP`) periodically checksums and re-validates kernel code pages, the system service table (SSDT), the IDT/GDT, and other core structures that pre-x64 era drivers used to patch routinely for legitimate (and illegitimate) purposes.
  2. 2Detection isn't instantaneous or synchronous with the modification — by design, the delay and the heavily obfuscated checking code make it impractical for an attacker to reliably patch around a specific check.
  3. 3A detected violation results in a kernel bugcheck, which is deliberately destructive: the design goal is that a tampered 64-bit kernel should crash rather than keep running in an unknown, untrustworthy state.
  4. 4**HyperGuard** raises the same idea a level: with Hyper-V/VBS active, the hypervisor itself (operating at a trust level the regular kernel cannot touch, per [Virtualization & the hypervisor](/levels/virtualization/overview)) monitors critical kernel-mode state from outside the kernel entirely — closing the gap where a sufficiently privileged kernel-mode attacker might otherwise disable or race PatchGuard's own in-kernel checks.

Key terms

KPP
Kernel Patch Protection, the formal name for what's commonly called PatchGuard.
CRITICAL_STRUCTURE_CORRUPTION
Bugcheck code 0x109, raised when PatchGuard detects tampering with protected kernel state.
DRIVER_VERIFIER_DETECTED_VIOLATION
A related but distinct bugcheck from Driver Verifier, often confused with PatchGuard triggers.

Why old-style antivirus hooking techniques stopped working on x64

Security products that used to hook the SSDT directly to intercept system calls on 32-bit Windows had to redesign entirely for 64-bit systems, specifically because PatchGuard treats that kind of modification as tampering and bugchecks the machine — pushing the entire industry toward supported mechanisms like minifilters and ETW instead.

Common misconception

Believing PatchGuard prevents kernel exploits — it doesn't stop an attacker from gaining kernel code execution in the first place; it only makes certain categories of persistent, stealthy *tampering* detectable after the fact, which is a materially different guarantee.

You should read next

Ranked from your current topic, related links, branch depth, and any active guided path.

Related topics