(C++) CheckRemoteDebuggerPresent by Glacius

Created the Saturday 26 September 2020. Updated 2 years, 2 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;