forked from running/neutronspoofer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugCheck.cs
30 lines (25 loc) · 847 Bytes
/
DebugCheck.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace DebuggerCheck
{
class DebugCheck
{
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CheckRemoteDebuggerPresent(IntPtr hProcess, ref bool isDebuggerPresent);
public static void Debug()
{
bool isDebuggerPresent = false;
CheckRemoteDebuggerPresent(Process.GetCurrentProcess().Handle, ref isDebuggerPresent);
Console.WriteLine("Debugger Detected: " + isDebuggerPresent);
Console.ReadLine();
if (isDebuggerPresent == true)
{
}
}
}
}