KPP Bypass
Disable PatchGuard (Kernel Patch Protection) at boot time by patching initialization functions in ntoskrnl.exe.
System Stability Risk
Disabling PatchGuard allows kernel code modifications but may cause system instability. Use only on test systems.
What is PatchGuard?
Kernel Patch Protection (KPP), commonly known as PatchGuard, is a Windows security feature that monitors critical kernel structures and code for unauthorized modifications. If tampering is detected, Windows triggers a BSOD (CRITICAL_STRUCTURE_CORRUPTION).
Bypass Strategy
The EFI driver scans ntoskrnl.exe's .text section for PatchGuard initialization function prologues and patches them with RET (0xC3) to prevent initialization.
KiFilterFiberContext
Main PatchGuard initialization routine. Patched with RET to skip entirely.
ExpLicenseWatchInitWorker
Secondary PatchGuard component. Also patched with RET.
; Original function prologue
push rbp
mov rbp, rsp
sub rsp, 0x40
...
; After patching
ret ; Immediately returns, skipping initializationHow It Works
- EFI driver hooks
gBS->ExitBootServices - When hook fires, read
DioProcessKppBypassNVRAM variable - If enabled, scan ntoskrnl.exe .text section for target patterns
- Locate
KiFilterFiberContextandExpLicenseWatchInitWorker - Replace first byte with
0xC3(RET instruction) - Restore original
ExitBootServicesand continue boot
Usage
- Install the EFI driver via title bar "Install EFI" button
- Navigate to UEFI Bootkit tab
- In Boot Patches section, toggle PatchGuard Bypass ON
- Click Save to NVRAM
- Reboot — PatchGuard will be disabled
NVRAM Variable
- • GUID:
{D10PR0C5-1337-4242-BEEF-CAFEBABE0001} - • Name:
DioProcessKppBypass - • Value: 0 (disabled) or 1 (enabled)
What You Can Do Without PatchGuard
- • Modify SSDT (System Service Descriptor Table)
- • Hook kernel functions directly
- • Modify IDT (Interrupt Descriptor Table)
- • Patch kernel code without triggering BSOD
- • Implement custom kernel-level monitoring
Implementation
| Item | Location |
|---|---|
| EFI implementation | efi/DioProcessEfi/PatchKpp.c |
| Rust bindings | crates/uefi/src/nvram.rs |