> Windows Syscalls
ntoskrnl.exeT1622T1106

NtDebugContinue

Resumes a debuggee thread after a debug event with a given NTSTATUS continue code.

Prototype

NTSTATUS NtDebugContinue(
  HANDLE     DebugObjectHandle,
  PCLIENT_ID DebuggeeId,
  NTSTATUS   ContinueStatus
);

Arguments

NameTypeDirDescription
DebugObjectHandleHANDLEinHandle to the debug object that delivered the original event.
DebuggeeIdPCLIENT_IDinClientId (UniqueProcess + UniqueThread) of the debuggee thread to resume — usually copied from DBGUI_WAIT_STATE_CHANGE.AppClientId.
ContinueStatusNTSTATUSinDBG_CONTINUE (0x00010002), DBG_EXCEPTION_NOT_HANDLED (0x80010001), or DBG_REPLY_LATER.

Syscall IDs by Windows version

Windows versionSyscall IDBuild
Win10 15070xC0win10-1507
Win10 16070xC3win10-1607
Win10 17030xC6win10-1703
Win10 17090xC7win10-1709
Win10 18030xC8win10-1803
Win10 18090xC9win10-1809
Win10 19030xCAwin10-1903
Win10 19090xCAwin10-1909
Win10 20040xCEwin10-2004
Win10 20H20xCEwin10-20h2
Win10 21H10xCEwin10-21h1
Win10 21H20xCFwin10-21h2
Win10 22H20xCFwin10-22h2
Win11 21H20xD4win11-21h2
Win11 22H20xD5win11-22h2
Win11 23H20xD5win11-23h2
Win11 24H20xD7win11-24h2
Server 20160xC3winserver-2016
Server 20190xC9winserver-2019
Server 20220xD3winserver-2022
Server 20250xD7winserver-2025

Kernel module

ntoskrnl.exeNtDebugContinue

Related APIs

ContinueDebugEventNtWaitForDebugEventNtCreateDebugObjectNtDebugActiveProcessNtRemoveProcessDebugDBG_CONTINUEDBG_EXCEPTION_NOT_HANDLEDDBG_REPLY_LATER

Syscall stub

4C 8B D1            mov r10, rcx
B8 D7 00 00 00      mov eax, 0xD7      ; Win11 24H2 SSN
F6 04 25 08 03 FE 7F 01   test byte ptr [0x7FFE0308], 1
75 03               jne short +3
0F 05               syscall
C3                  ret
CD 2E               int 2Eh
C3                  ret

Undocumented notes

The complement of `NtWaitForDebugEvent` — every event returned by the wait must be ack'd or the debuggee thread stays frozen indefinitely. `DBG_CONTINUE` says "I handled this, no exception escapes to the debuggee's SEH"; `DBG_EXCEPTION_NOT_HANDLED` says "let SEH unwind in the debuggee"; the less-known `DBG_REPLY_LATER` (Win10 1607+) defers the ack so a debugger can collect multiple events without freezing intervening threads. The `ClientId` parameter is what makes this thread-granular — a multi-threaded debuggee can have one thread resumed while others stay parked.

Common malware usage

Always paired with `NtWaitForDebugEvent`. In the self-debug anti-attach pattern the loop systematically replies `DBG_CONTINUE` to *every* exception, which makes the debuggee impervious to bog-standard analyst tricks (`int 3` planted in code, `__debugbreak`, `RaiseException(0x80000003)`) — those would normally surface in an attached external debugger but here are swallowed silently by the self-debugger. A more sophisticated variant inspects the event, checks if the exception is one the implant itself raised (e.g. a stego'd `int 3` whose address matches a known anti-debug check) and selectively replies `DBG_CONTINUE` vs `DBG_EXCEPTION_NOT_HANDLED` to make the debuggee believe no debugger is present (the `IsDebuggerPresent`/PEB.BeingDebugged path stays clean because the *external* debugger never attached).

Detection opportunities

`NtDebugContinue` alone is noisy — every running debugger calls it constantly. The detection value is in the parent context: a process that has both `EPROCESS.DebugPort != NULL` and is itself the debugger (its thread holding the debug object handle), where the debuggee is *itself* or a child. Combined with `NtCreateDebugObject` + `NtDebugActiveProcess(NtCurrentProcess())` this is the self-debug anti-attach signature. ETW Microsoft-Windows-Kernel-Process surfaces the debug-port transitions.

Direct syscall examples

cContinue every event silently

// Inside the self-debug loop, after NtWaitForDebugEvent returned `sc`.
NTSTATUS status = (sc.NewState == DbgExceptionStateChange)
    ? DBG_CONTINUE                  // swallow ALL exceptions silently
    : DBG_CONTINUE;                 // and pass non-exception events through

NtDebugContinue(hDbg, &sc.AppClientId, status);

cSelective forwarding (smarter anti-debug)

// Only swallow our own planted int3s; let other exceptions surface to the debuggee.
if (sc.NewState == DbgExceptionStateChange) {
    PVOID pc = (PVOID)sc.StateInfo.Exception.ExceptionRecord.ExceptionAddress;
    NTSTATUS code = sc.StateInfo.Exception.ExceptionRecord.ExceptionCode;

    NTSTATUS reply;
    if (code == STATUS_BREAKPOINT && IsOurAntiDebugProbe(pc)) {
        reply = DBG_CONTINUE;                  // hide it from any SEH check
    } else {
        reply = DBG_EXCEPTION_NOT_HANDLED;     // let the debuggee see/handle it
    }
    NtDebugContinue(hDbg, &sc.AppClientId, reply);
} else {
    NtDebugContinue(hDbg, &sc.AppClientId, DBG_CONTINUE);
}

asmx64 direct stub

; NtDebugContinue direct syscall (Win11 24H2 SSN 0xD7)
NtDebugContinue PROC
    mov  r10, rcx
    mov  eax, 0D7h
    syscall
    ret
NtDebugContinue ENDP

MITRE ATT&CK mappings

Last verified: 2026-05-20