ZwContinue

ZwContinue is a low-level Windows system call found in ntdll.dll. It is used to continue the execution of a thread after an exception, and it's often associated with structured exception handling (SEH) and context switching.

Key details:

  • Prototype (roughly):

    NTSTATUS ZwContinue(PCONTEXT ContextRecord, BOOLEAN TestAlert);  
    • ContextRecord: A pointer to a CONTEXT structure that defines the processor state to resume.

    • TestAlert: If TRUE, the system checks for pending alerts (e.g., APCs) before continuing.

  • ZwContinue is usually called during:

    • Exception handling (NtContinue is often used interchangeably).

    • Thread context spoofing (common in malware).

    • Control flow redirection (e.g., after a VEH or SEH handler wants to resume execution elsewhere).

In reverse engineering:

If you see ZwContinue, you might be dealing with:

  • Obfuscation techniques: where control flow is intentionally scrambled and resumed with crafted CONTEXT structures.

  • Shellcode loaders or malware: often use ZwContinue after setting up a fake exception or modifying a context to jump to shellcode.

Red flags:

  • Manual context setup just before ZwContinue.

  • Execution resuming in non-module memory (e.g., heap, RWX sections).

  • Usage without a real exception trigger.


Comments

Popular posts from this blog

Avoiding detection when injecting a DLL into a game process

Some global variable set, mystery function

FULL REFLECTIVE INJECTION PACK