⚠️ Based on the original DefenderCheck project by matterpreter: https://github.com/matterpreter/DefenderCheck
Binary signature isolation tool using Microsoft Defender.
This is a native Delphi 12 console implementation of a binary bisection technique that can identify the exact byte region that triggers Microsoft Defender detection.
DefenderCheck automates binary bisection against MpCmdRun.exe (Microsoft Defender CLI scanner).
If a file is detected as malicious, the tool:
- Splits the file in half
- Scans the first portion
- Determines which region triggers detection
- Repeats recursively
- Identifies the precise byte boundary responsible
- Outputs a hex dump of the offending region
This allows rapid detection analysis and signature research in controlled environments.
- Native Win32 / Win64 Delphi implementation
- Uses
CreateProcessW(no external dependencies) - Captures stdout via pipe redirection
- 30 second scan timeout
- Recursive binary narrowing
- Automatic
C:\Tempcreation - Hex dump of last 256 suspicious bytes
- Optional debug mode
- Microsoft Defender installed (Fully removing via regkeys will cause false negatives)
- All settings can be disabled (Realtime protection, cloud submission etc can AND SHOULD all be disabled)
MpCmdRun.exeavailable at:
C:\Program Files\Windows Defender\MpCmdRun.exe
DefenderCheck.exe payload.exeDefenderCheck.exe payload.exe debugTarget file size: 18432 bytes
Analyzing...
[!] Identified end of bad bytes at offset 0x4A3F
File matched signature: "Trojan:Win32/Example.A"
00004930 90 90 90 E8 34 12 00 00 48 65 6C 6C 6F 20 41 56 ....4...Hello AV
00004940 21 21 21 00 00 00 00 00 !!!.....
The detection logic relies on Defender exit codes:
| Exit Code | Meaning |
|---|---|
| 0 | No threat found |
| 2 | Threat found |
| Other | Error |
The algorithm performs a controlled binary search:
Detected → halve region
Clean → increase region by 50%
Repeat until boundary found
When only a 1-byte delta remains, the tool:
- Reports offset
- Extracts last 256 bytes
- Performs hex dump
- Prints signature name (if available)
Core components:
RunProcessCapture— CreateProcessW + stdout pipe captureScan— Defender invocation + exit code mappingHalfSplitter— Recursive narrowingOvershot— Progressive expansionHexDump— Byte visualization
- Detection research
- AV behavior analysis
- Binary testing and mutation analysis
- Lab environments
This tool is intended for defensive research and controlled environments only.
- Disk-based scanning (writes to
C:\Temp) - Not optimized for very large files (>100MB)
- Dependent on Defender CLI availability
⚠️ This readme (documentation) was generated with the assistance of AI.
⚠️ All code is human written.
