Zero-CRT Native Architecture + Dual Kernel BYOVD Engine + RTP/TP Slider Control
v2.1 brings a complete architectural overhaul focused on Zero-CRT native implementation, sub-100KB binary size record, dual-driver kernel redundancy, and full MASM string obfuscation.
π Spoiler: Detailed v2.1.0 Architecture & Release Notes
- 100% Native OS APIs (
/NODEFAULTLIB) β eliminated all C/C++ runtime library dependencies (libcmt.lib,vcruntime*.dll,msvcrt.dll). Executable dropped from ~380 KB down to 80.5 KB (>78% reduction). Automateddumpbin /dependentsin CI/CD pipeline enforces 0 CRT imports. - Custom Native CRT Runtime β handwritten implementations for memory (
memset,memcpy,memmove), string algorithms (StrLen,StrEqual,StrCopy,StrConcat,IntToStr,HexToStr), and float/hex formatters running directly on Win32 without standard library overhead. - Micro-Icon PNG CAB Compression β transformed embedded multi-res icon to optimized 48x48 PNG format (1,088 B header), slashing icon resource overhead and total binary size.
- Two-tier Driver Redundancy β engine kill upgraded from a single driver to dual signed kernel drivers (
1and2), packed into a single LZX compressed CAB stream within the icon. - Extension-Independent Driver Loading β drivers extract and load directly without
.sysextensions (%SystemRoot%\System32\drivers\1and\2). Windows SCMCreateServiceWand kernel loader resolve native PE headers directly. - Automated Driver Teardown β automated cleanup purges both driver files from disk and stops services immediately after the kill cycle completes.
- Zero Plaintext Driver Identifiers β driver service names and device identifiers completely purged from executable
.rdatastring tables. - Algorithmic Assembly Decoders β implemented x64 MASM routines (
wdc1.asmandwdc2.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 viadumpbinand binary string inspection.
- Instant Busy Cursor Cancellation (
IDC_WAIT/IDC_APPSTARTING) β integratedMsgWaitForMultipleObjects(0, nullptr, FALSE, 0, QS_ALLINPUT)at entry point, overlay creation, and post-ShellExecuteW. SatisfiesWaitForInputIdleinstantly (0 ms), eliminating the spinning wheel wait cursor on Windows 11. - Overlay Window Cursor Enforcement β registered
IDC_ARROWcursor and handledWM_SETCURSORin the Direct2D fullscreen overlay (WDCOverlay), preventing shell wait cursor leakage over the "PLEASE WAIT" screen.
- Dynamic Mathematical Banner Lines β replaced hardcoded banner string literals (
====,+----+, space paddings) in.rdatawith procedural loop-fill console routines (PrintRepeated,PrintLineRepeated,PrintDoubleBorder,PrintSingleBorder), saving.rdatamemory. - Codebase Sanitization β completely purged informal/script-kiddie jargon ("payload", etc.) in favor of professional systems engineering nomenclature across comments, identifiers, and logs.
- Synchronized Build System β automated alignment between
WinDefCtl.vcxprojandWinDefCtl.vcxproj.filterswith integrated MASM toolchain.
Single standalone native executable (80.5 KB) β no installer, no dependencies, zero CRT dependencies (/NODEFAULTLIB).
Run as Administrator.
PowerShell edition: data/WinDefCtl-v2.ps1 (~65 KB, no compiler needed).
π Spoiler: ARM64 edition (v1.1.2) β byproduct of the research
This build was never officially announced β it is a direct byproduct of the Analyze Defender research into hooking the SecHealthUI XAML tree. While implementing and verifying the injection technique on an ARM64 machine, a fully functional native binary emerged as a side effect.
WinDefCtl_arm64.exe is attached to the release for anyone who needs it.
It covers all five Threat Settings sliders individually β something the x64 v2.0
line does not expose through a single command:
WinDefCtl rtp on|off # Real-Time Protection
WinDefCtl tp on|off # Tamper Protection
WinDefCtl cdp on|off # Cloud-delivered protection
WinDefCtl ass on|off # Automatic sample submission
WinDefCtl ddp on|off # Dev Drive protection
The binary must be compiled natively for ARM64 β it is injected into SecHealthUI.exe
which on ARM64 hardware is a native ARM64 process and cannot host x86-64 code.
Source code is not published for this build.
WinDefCtl kill # Kill Defender engine (no restart required)
WinDefCtl restore # Re-enable Defender engine
WinDefCtl rtp status # Check Real-Time Protection state
WinDefCtl rtp off # Disable Real-Time Protection
WinDefCtl rtp on # Enable Real-Time Protection
WinDefCtl tp status # Check Tamper Protection state
WinDefCtl tp off # Disable Tamper Protection
WinDefCtl tp on # Enable Tamper Protection# Kill engine completely (blocks MsMpEng restart via IFEO)
WinDefCtl kill
# ... do your thing ...
# Restore everything
WinDefCtl restore
# Or: just disable RTP for a moment
WinDefCtl rtp off
WinDefCtl rtp onTwo-stage, no restart required:
Stage 1 β IFEO offline hive bypass:
Direct registry write to Image File Execution Options is blocked by Tamper Protection.
WinDefCtl bypasses this using an offline hive cycle:
RegSaveKeyExβ dump liveIFEOkey to%TEMP%\Ifeo.hivRegLoadKey(HKLM, TempIFEO, Ifeo.hiv)β mount asHKLM\TempIFEO- Write
Debugger=systray.exetoTempIFEO\MsMpEng.exe(and two secondary targets) RegUnLoadKey(TempIFEO)β unmountRegRestoreKey(IFEO, Ifeo.hiv, REG_FORCE_RESTORE)β kernel-level force-replace
REG_FORCE_RESTORE operates below the Tamper Protection filter. Requires SE_BACKUP_NAME + SE_RESTORE_NAME.
Stage 2 β Ring-0 process kill via Dual Kernel Engine:
Both kernel drivers carry valid digital signatures.
Loads without DSE bypass, without HVCI restart, without any unsigned-driver prerequisites.
- Drivers extracted from embedded LZX CAB (appended to the
.icoresource atICON_HEADER_SIZEoffset) - Written to
System32\drivers\1andSystem32\drivers\2(extension-independent SCM loading) - Driver service names and device identifiers reconstructed dynamically via x64 MASM assembly routines (
wdc1.asm,wdc2.asm) β 0 plaintext string occurrences in.rdata - Terminates
MsMpEng.exe+SecurityHealthSystray.exe;SecurityHealthServicestopped via SCM - Immediate atomic cleanup after use (stop services, delete services, remove driver files from disk)
Opens windowsdefender://threatsettings with SW_SHOWMINNOACTIVE (minimized, not activated).
Full-screen Direct2D overlay covers the desktop immediately β hiding the minimized window from view.
Toggles the switch via IUIAutomationTogglePattern.
Overlay technical details:
WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATEfullscreen popup, fully opaque black- Direct2D + DirectWrite rendering: Consolas Bold 80pt, pulsing green, animated dots, CRT scanlines
- 0 ms cursor delay: Instant release of Windows
WaitForInputIdleviaMsgWaitForMultipleObjects(..., QS_ALLINPUT)to cancel the spinning wait cursor (IDC_WAIT/IDC_APPSTARTING) WM_SETCURSORhandler andIDC_ARROWregistration prevent shell wait cursor leakage- Background thread β non-blocking, no window activation
- Released on
Hide()viaPostMessage(WM_CLOSE)
Before UI automation, UAC prompts are suppressed:
- Backup
ConsentPromptBehaviorAdmin+PromptOnSecureDesktoptoHKLM\...\UACStatus - Set both to 0 (no prompts)
- Automatically restored after operation (or on next run if interrupted)
First run after login: Windows Security components are not yet loaded in memory.
WinDefCtl detects this via a volatile registry marker at HKCU\Software\WinDefCtl\WinDefCtl_Warmed
and pre-loads the Security window before automation begins (~5-7 seconds, first run only).
data/WinDefCtl-v2.ps1 β same command palette as the C++ binary,
in a single self-contained PowerShell script (~65 KB). No compiler, no Visual Studio.
Drop the file anywhere, 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 in $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 β reg.exe add Debugger=systray.exe β 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 a single UACStatus DWORD, restored after the toggle |
| Overlay | Fullscreen multi-monitor System.Windows.Forms.Form, pulsing "PLEASE WAIT" label (sine-wave grey-to-white, 25 FPS) |
| Cold boot detect | Volatile marker HKCU\Software\Temp\WinDefCtl_Warmed |
After the kill flow finishes, all of the following are gone:
wsftprmservice (stopped +DeleteService)%SystemRoot%\System32\drivers\kvckiller.sys(deleted)%TEMP%\kk.caband%TEMP%\Ifeo.hiv*(deleted)
Only IFEO entries remain (intentional β that is the active block; restore clears them).
# Source driver: data\kvckiller.sys
.\generator\build-ps.ps1
# Output: out\WinDefCtl-v2.ps1The generator runs makecab.exe, base64-encodes the CAB into 76-char lines and
substitutes into generator\template.ps1. No external NuGet packages, no .NET
build tools β pure inbox Windows.
- Slower startup (~1.5 s PowerShell + .NET cold load vs. ~200 ms native exe).
- Requires
-ExecutionPolicy Bypassor a signed copy. - Defender RTP may flag the script on disk (CAB-encoded signed driver inside a PS1). The compiled C++ binary embeds the same driver as an ICO resource so it sits below most heuristics.
- No D2D overlay β uses WinForms.
Requirements: Visual Studio 2022 (v145 toolset), Windows SDK 10.0+
# Full chain: embed driver β compile β stamp timestamps β clean artifacts
.\build.ps1
# Skip driver embedding (use existing ICON\WinDefCtl.ico)
.\build.ps1 -SkipDriverPack
# Custom timestamp (for reproducible builds)
.\build.ps1 -Timestamp "2030-01-01 00:00:00"Build chain:
Build-DriverIconβmakecabLZX compresses drivers1and2, appends CAB toIcoBuilder\WinDefCtl.icoβICON\WinDefCtl.ico- Regenerates
src\GenIconSize.hwith exact icon header byte count (1088 B) - MSBuild
Release|x64:/NODEFAULTLIB(Zero-CRT),/O1//Os(FavorSize),/GF,/Gy,/Gw, MASM assembly compilation - Dumpbin import check β automated verification of 0 CRT imports
- Timestamp stamp β
bin\WinDefCtl.exe - Cleans
obj\
Output: bin\WinDefCtl.exe (80.5 KB, 100% native Windows OS APIs)
- OS: Windows 11 (tested on 24H2 / 26H1 / 26H2)
- Privileges: Administrator
- Architecture: x64
- Dependencies: none (Zero-CRT, 100% native Win32/NT APIs)
- Size: ~80 KB
killdoes NOT unloadWinDefendservice β IFEO preventsMsMpEng.exefrom starting on service startrestoreremoves the IFEO block then startsWinDefend+SecurityHealthService- UI Automation (
rtp/tp) requires an active user session - Cannot run from Safe Mode or Windows PE
- kvckiller.sys is digitally signed β no HVCI workaround needed
| marek@wesolowski.eu.org | |
| Phone | +48 607-440-283 |
| Website | https://kvc.pl |
| GitHub | https://github.com/wesmar/WinDefCtl |
Donations:
- PayPal: paypal.me/ext1
- Revolut: revolut.me/marekb92
For authorized security testing and system administration only.
User assumes full legal responsibility for all actions performed.
Misuse may violate computer crime laws in your jurisdiction.
Β© 2026 Marek WesoΕowski β WESMAR