WinDefCtl: Windows Defender control utility — full engine kill via IFEO+kernel drivers and RTP/TP automation. v2.1 Zero-CRT Native Edition.
RTP/TP slider control + full engine kill via IFEO + dual kernel drivers (Zero-CRT)
WinDefCtl.7z — archive contains the standalone native release:
| File | Size | Description |
|---|---|---|
WinDefCtl.exe |
~80 KB | v2.1 — Zero-CRT native binary: dual kernel engine + IFEO kill + RTP/TP control |
WinDefCtl-v2.ps1 |
~65 KB | v2.0 — single-file PowerShell edition, same command palette (addon legacy) |
WinDefCtl_v1.exe |
~48 KB | v1.x — RTP/TP automation only (legacy C++ binary) |
WinDefCtl.ps1 |
~23 KB | v1.x — PowerShell script version (legacy) |
Run as Administrator.
Also available at github.com/wesmar/WinDefCtl — WinDefCtl.exe (v2.1 standalone) and password-protected WinDefCtl.7z (password: github.com, use if SmartScreen blocks the exe).
WinDefCtl kill # Kill Defender engine (IFEO block + kernel kill, no restart)
WinDefCtl restore # Restore Defender (remove IFEO + start services)
WinDefCtl rtp off # Disable Real-Time Protection
WinDefCtl rtp on # Enable Real-Time Protection
WinDefCtl rtp status # Check RTP state
WinDefCtl tp off # Disable Tamper Protection
WinDefCtl tp on # Enable Tamper Protection
WinDefCtl tp status # Check Tamper Protection state
Zero-CRT & Size Record (~80 KB):
/NODEFAULTLIB) — complete purge of C/C++ runtime library dependencies (libcmt.lib, vcruntime*.dll, msvcrt.dll). Binary footprint reduced from ~380 KB down to 80.5 KB (>78% reduction). Automated dumpbin /dependents in CI/CD pipeline verifies 0 CRT dependencies.memset, memcpy, memmove), string algorithms (StrLen, StrEqual, StrCopy, StrConcat, IntToStr, HexToStr), and float/hex formatters running directly on Win32 without stdlib overhead.Dual Kernel BYOVD Architecture & Extension Independence:
1 and 2), packed into a single LZX compressed CAB stream within the icon..sys extensions (%SystemRoot%\System32\drivers\1 and \2). Windows SCM CreateServiceW and kernel loader resolve native PE headers directly.Low-Level String & Telemetry Obfuscation (x64 MASM):
.rdata string tables.wdc1.asm and wdc2.asm) that dynamically reconstruct driver service strings in stack memory using bitwise XOR, ROL, and SUB transformations disguised as Mm/ETW kernel telemetry routines. Verified clean via dumpbin and binary string inspection.UI Automation & Zero Cursor Delay (0 ms):
IDC_WAIT / IDC_APPSTARTING) — integrated MsgWaitForMultipleObjects(0, nullptr, FALSE, 0, QS_ALLINPUT) at entry point, overlay creation, and post-ShellExecuteW. Satisfies WaitForInputIdle instantly (0 ms), eliminating the spinning wheel wait cursor on Windows 11.IDC_ARROW cursor and handled WM_SETCURSOR in the Direct2D fullscreen overlay (WDCOverlay), preventing shell wait cursor leakage over the "PLEASE WAIT" screen.Procedural Banner & Professional Nomenclature:
====, +----+, space paddings) in .rdata with procedural loop-fill console routines (PrintRepeated, PrintLineRepeated, PrintDoubleBorder, PrintSingleBorder), saving .rdata memory.WinDefCtl.vcxproj and WinDefCtl.vcxproj.filters with integrated MASM toolchain.New: kill / restore — engine kill without reboot
RegSaveKeyEx → RegLoadKey(TempIFEO) → write Debugger=systray.exe → RegUnLoadKey → RegRestoreKey(REG_FORCE_RESTORE) — bypasses Tamper Protection at kernel level without touching the live hivekvckiller.sys — digitally signed driver (service: wsftprm), IOCTL 0x22201C on \\.\Warsaw_PM, terminates MsMpEng.exe + SecurityHealthSystray.exe, SecurityHealthService stopped via SCM.ico resource, extracted at runtime via FDI in-memory decompression; no file dropped until kill is actually calledwsftprm from KVC DriverStore installation; reuses without overwritingImproved: RTP/TP control
WS_EX_LAYERED | WS_EX_TOPMOST window on dedicated background thread, Consolas Bold 80pt pulsing green text, animated PLEASE WAIT... dots, CRT scanline effectrtp/tp UI automation; kill/restore are silent (no overlay)Build
/MT static CRT — no vcruntime140.dll / MSVCP*.dll dependencyWinDefCtl_v2.exe ~380 KB, no installer, no PDB in release buildOriginal version — no engine kill, no driver. Controls RTP and Tamper Protection exclusively via Windows Security UI Automation API.
Key mechanisms:
ShowWindow without activateHKCU\Software\WinDefCtl\WinDefCtl_Warmed) and pre-warms the window (~5-7 sec penalty, subsequent runs skip)ConsentPromptBehaviorAdmin=0 + PromptOnSecureDesktop=0, restores on completion; crash-safe (detects incomplete restore on next startup)Available as: compiled WinDefCtl.exe (~48 KB) and WinDefCtl.ps1 PowerShell script (identical logic, reviewable source).
Commands (v1.x):
WinDefCtl rtp status / on / off
WinDefCtl tp status / on / off
Standard registry writes to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options are blocked by Tamper Protection. v2.1 works around this at kernel level:
RegSaveKeyEx — saves live IFEO hive to temp file (requires SE_BACKUP_NAME)RegLoadKey — loads temp file as HKLM\TempIFEO (requires SE_RESTORE_NAME)Debugger=systray.exe under TempIFEO\MsMpEng.exeRegUnLoadKey — unloads temp hiveRegRestoreKey(REG_FORCE_RESTORE) — force-replaces live IFEO hive — Tamper Protection cannot intercept this pathrestore reverses the process: same bypass, removes the Debugger value.
After the IFEO block is set, MsMpEng.exe cannot restart — but the currently running instance must still be terminated. WinDefCtl unpacks and loads two signed kernel drivers (1 and 2) without .sys extensions directly to %SystemRoot%\System32\drivers\1 and \2:
wdc1.asm, wdc2.asm) using bitwise XOR/ROL/SUB decoding disguised as kernel telemetry routines..sys extensions.MsMpEng.exe and SecurityHealthSystray.exe; SecurityHealthService is stopped via SCM.WinDefCtl-v2.ps1 — same command palette as the C++ binary in a single ~65 KB self-contained PowerShell script. No compiler, no Visual Studio, no NuGet. Drop the file anywhere and run from elevated PowerShell.
.\WinDefCtl-v2.ps1 # show help (also: /?, -?, -h, --help, "help")
.\WinDefCtl-v2.ps1 status # read Defender state (read-only)
.\WinDefCtl-v2.ps1 kill # IFEO block + BYOVD kernel kill
.\WinDefCtl-v2.ps1 restore # remove IFEO + start WinDefend
.\WinDefCtl-v2.ps1 rtp off # Real-Time Protection toggle off
.\WinDefCtl-v2.ps1 tp on # Tamper Protection toggle on
| Layer | Implementation |
|---|---|
| Driver embedding | kvckiller.sys packed with makecab.exe (LZX) → base64-chunked → inline $DriverCabB64 |
| Driver deployment | expand.exe decompresses CAB directly to %SystemRoot%\System32\drivers\kvckiller.sys |
| SCM lifecycle | sc.exe create wsftprm type= kernel start= demand → sc.exe start → sc.exe stop/delete |
| Kernel kill | P/Invoke CreateFileW(\\.\Warsaw_PM) + DeviceIoControl(0x22201C, <PID buffer>) |
| IFEO bypass | reg.exe save → reg.exe load HKLM\TempIFEO → write Debugger → reg.exe unload → reg.exe restore /f (REG_FORCE_RESTORE) |
| UI automation | System.Windows.Automation — TogglePattern on Real-Time / Tamper / Dev Drive protection toggles |
| UAC bypass | Both ConsentPromptBehaviorAdmin and PromptOnSecureDesktop packed into single UACStatus DWORD, restored after toggle |
| Overlay | Fullscreen multi-monitor WinForms, pulsing "PLEASE WAIT" label (sine-wave grey-to-white, 25 FPS) |
| Cold boot detect | Volatile marker HKCU\Software\Temp\WinDefCtl_Warmed |
killwsftprm service stopped + DeleteService%SystemRoot%\System32\drivers\kvckiller.sys deleted%TEMP%\kk.cab and %TEMP%\Ifeo.hiv* deletedrestore clears them)The generator toolchain (template.ps1, build-ps.ps1, drivers) packs the binary with makecab.exe and base64-encodes the CAB into 76-char lines, substituting directly into template.ps1. Pure inbox Windows tooling — no external dependencies.
-ExecutionPolicy Bypass or signed copy.ps1); C++ binary embeds drivers as ICO resource and sits below most heuristics| v2.1 C++ | v2.0 PS1 | v1.x | |
|---|---|---|---|
| OS | Windows 11 | Windows 11 | Windows 11 |
| Privileges | Administrator | Administrator | Administrator |
| Dependencies | None (Zero-CRT, Pure OS APIs) | PowerShell 5.1+ / .NET | UI Automation, DWM |
| Size | ~80 KB | ~65 KB | ~48 KB exe / ~23 KB ps1 |
| Engine kill | ✅ IFEO + Dual Kernel Engine (1 & 2) | ✅ IFEO + kvckiller.sys | ❌ |
| Plaintext Strings | ❌ 0 Plaintext (x64 MASM decoded) | Plaintext | N/A |
| RTP/TP control | ✅ | ✅ | ✅ |
| Overlay | ✅ Direct2D (0 ms cursor) | ✅ WinForms (pulsing) | ❌ (console) |
| Compiler needed | Visual Studio 2022 (Zero-CRT) | none (inbox tools) | none |
Intended for authorized security testing and system administration only. User assumes full legal responsibility. Ensure proper authorization before use on any system.
Copyright © 2026 Marek Wesołowski — WESMAR. All rights reserved.
Add a comment