(C++) CheckRemoteDebuggerPresent by Glacius

Created the Saturday 26 September 2020. Updated 3 years, 6 months ago.

Code

            #include "windows.h"
 
int main(void)
{
    BOOL HasDebugPort = FALSE;
 
    if (CheckRemoteDebuggerPresent(GetCurrentProcess(), &HasDebugPort))
    {
           ExitProcess(0); // Running in ring-3 debugger
    }
    // Running outside ring-3 debugger
    return 0;