我试图检测调试器和我得到错误“不能解决符号'Dte'”,即使与envdte引用。谷歌什么都没给我。谢谢。
using EnvDTE;
namespace test
{
static class Program
{
[STAThread]
static void Main()
{
foreach (EnvDTE.Process p in Dte.Debugger.DebuggedProcesses) {
if (p.ProcessID == spawnedProcess.Id) {
}
}
}
}
}发布于 2015-09-18 00:01:14
我需要检测附加的调试器(如Ollydbg)
若要检查进程是否有附加于yo的调试器,可以使用:
如何检查调试器是否附加了
代码:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
public class DetectDebugger
{
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CheckRemoteDebuggerPresent(IntPtr hProcess, ref bool isDebuggerPresent);
public static void Main()
{
bool isDebuggerPresent = false;
CheckRemoteDebuggerPresent(Process.GetCurrentProcess().Handle, ref isDebuggerPresent);
Console.WriteLine("Debugger Attached: " + isDebuggerPresent);
Console.ReadLine();
}
}发布于 2015-09-17 23:46:48
C#是一种区分大小写的语言。
它的DTE (大写)不是Dte。https://msdn.microsoft.com/en-us/library/envdte.dte.aspx文档
https://stackoverflow.com/questions/32641660
复制相似问题