You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
RandomCrocodile
committed
fix: strengthen anti-debug startup detection and polling (#76)
Phase 1 hardening for the anti-debug protection. The core complaint — a debugger
(e.g. dnSpy F5) can attach and the app runs before the async worker ever checks —
is fixed portably:
- Safe and Win32 modes now run a BLOCKING debugger check inside Initialize()
(injected at the top of the module cctor), so an assembly launched under a
debugger fails immediately, before any user code runs, instead of only being
caught later on the background thread.
- Win32's startup check also calls the native IsDebuggerPresent().
- Reduced the watchdog poll interval from 1000ms to 200ms and removed the 500ms
initial sleep, shrinking the detection race window.
Deliberately NOT changing the default mode from Safe to Win32 (issue's proposal
1): Win32 P/Invokes ntdll/kernel32 and would crash cross-platform .NET targets on
non-Windows, conflicting with the project's all-frameworks goal. The strengthened
Safe mode addresses the reported issue portably; OS-aware mode selection is a
larger Phase 2 change.
Added AntiDebug.Test (safe + win32) as a regression guard that an anti-debug
protected assembly still runs normally when not debugged (START/output/exit 42).
0 commit comments