Anti-Debug Enterprise
Anti-debug makes attaching a debugger to your obfuscated application unworkable. Detection is layered so that removing a single check does not disable the protection. When a debugger is detected at runtime, the process exits immediately and cannot be saved by any exception handler.
Usage
| CLI | MSBuild | Default |
|---|---|---|
| (enabled by default at Enterprise) | (enabled by default at Enterprise) | On |
--no-anti-debug | <DemeanorNoAntiDebug>true</DemeanorNoAntiDebug> | Disable |
What It Detects
- Managed debuggers — Visual Studio, JetBrains Rider, dnSpy, and any other CLR-aware debugger. Detection works on Windows, Linux, and macOS.
- Native debuggers (Windows) — WinDbg, x64dbg, OllyDbg, and similar tools that operate below the managed runtime.
When a debugger is detected, the process terminates without giving any exception handler a chance to suppress the exit. Detection is hidden inside the obfuscated code alongside your application logic so it cannot be located by signature scanning.
NativeAOT Compatibility
All detection paths are NativeAOT-safe. The Windows-only check is guarded so it is trimmed out of non-Windows builds.
When to Disable
- Debugging obfuscated builds: If you need to attach a debugger to a Release build for production diagnostics, disable anti-debug for that build.
- Automated testing under a debugger: Some test runners attach a debugger. Anti-debug will terminate the process. Use
--no-anti-debugfor test configurations.
Ready to protect your .NET code?