我确实找到了这段代码,但在调试时它没有返回true:[DllImport("kernel32.dll",CharSet=CharSet.Auto,ExactSpelling=true)]internalstaticexternboolIsDebuggerPresent(); 最佳答案 是的:System.Diagnostics.Debugger.IsAttached 关于c#-是否有等效于IsDebuggerPresent()的C#?,我们在StackOverflow上找到一个类似的问题
一、调用系统的IsDebuggerPresent函数(1)实现程序 最简单也是最基础的,Windows提供的API接口:IsDebuggerPresent(),这API实际上就是访问PEB的BeingDebugged标志来判断是否处于调试状态。 使用vs调试此段代码,弹出"检测到调试器"。#include#includeDWORDWINAPIThreadFunctionCallBack(LPVOIDlp){while(true){if(IsDebuggerPresent()){printf("检测到调试器\n");}}}intmain(){CreateThread(NULL,NULL,Th
一、调用系统的IsDebuggerPresent函数(1)实现程序 最简单也是最基础的,Windows提供的API接口:IsDebuggerPresent(),这API实际上就是访问PEB的BeingDebugged标志来判断是否处于调试状态。 使用vs调试此段代码,弹出"检测到调试器"。#include#includeDWORDWINAPIThreadFunctionCallBack(LPVOIDlp){while(true){if(IsDebuggerPresent()){printf("检测到调试器\n");}}}intmain(){CreateThread(NULL,NULL,Th