[DllImport("kernel32.dll")]
static extern bool IsDebuggerPresent();
None.
This is a quick way to help protect your applications from being reverse engineered at runtime. Call this when your application starts and exit if it returns true.
Call this before your application starts to protect it from runtime analysis. This is a weak form of protection, and is trivially bypassed. For a more robust mechanism, use a .NET obfuscator tool.
// debug checking in debug builds would make it impossible to debug in Visual Studio
#if !DEBUG
if (IsDebuggerPresent() == true) {
Application.Exit();
}
#endif
Do you know one? Please contribute it!