Skip to main content

Introduction

SysWhispers4 generates a complete C/ASM API that allows you to invoke Windows NT kernel functions directly via syscalls, bypassing user-mode hooks placed by AV/EDR products on ntdll.dll.

Generated Files

When you run SysWhispers4, it produces the following files:

API Components

The generated API consists of four main categories:

1. Initialization Functions

Required setup before using NT syscalls:
  • SW4_Initialize() — Resolves system call numbers (SSNs) using your chosen resolution method
  • Returns TRUE on success, FALSE on failure
  • Must be called before any SW4_Nt* functions (except for static SSN resolution)

2. NT Syscall Functions

Direct wrappers for Windows NT kernel functions:
  • 64 supported functions spanning memory, process, thread, file, token operations
  • All functions prefixed with SW4_Nt* (e.g., SW4_NtAllocateVirtualMemory)
  • Identical signatures to documented NTAPI functions
  • Return NTSTATUS codes

3. Evasion Helper Functions

Optional functions for AV/EDR bypass (generated based on command-line flags):
  • SW4_PatchEtw() — Suppress user-mode ETW event delivery
  • SW4_PatchAmsi() — Bypass AMSI scanning
  • SW4_UnhookNtdll() — Remove inline hooks from ntdll
  • SW4_AntiDebugCheck() — Detect debugger/analysis tools
  • SW4_SleepEncrypt(ms) — Ekko-style memory encryption during sleep

4. Utility Functions

Internal helpers (advanced use cases):
  • SW4_HatchEggs() — Runtime egg marker replacement (for --method egg)
  • SW4_PopulateSsnTable() — Dynamic SSN resolution (internal)

Function Naming Convention

All generated functions follow this pattern:
  • Default prefix: SW4_
  • Customizable: Use --prefix flag to change (e.g., --prefix MYMY_NtAllocateVirtualMemory)

Return Values

NT syscall functions return NTSTATUS codes:

Usage Patterns

Basic Initialization

With Evasion Features

Thread Safety

SW4_Initialize() is not thread-safe. Call it once from your main thread before spawning additional threads.
Once initialized, the SW4_Nt* syscall functions are thread-safe.

Compiler Support

The generated code supports:
  • MSVC (Microsoft Visual C++) — Uses MASM .asm files
  • MinGW — Uses GAS inline assembly in .c files
  • Clang — Uses GAS inline assembly in .c files
Use the --compiler flag when generating:

Architecture Support

Use the --arch flag:

Next Steps

Initialization

Learn about SW4_Initialize() and SSN resolution

Memory Functions

Allocate, read, write, and protect memory

Process & Thread

Create and manipulate processes and threads

Evasion Helpers

ETW bypass, AMSI bypass, unhooking, and more