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 onntdll.dll.
Generated Files
When you run SysWhispers4, it produces the following files:| File | Purpose |
|---|---|
SW4Syscalls_Types.h | NT type definitions — structures, enums, typedefs |
SW4Syscalls.h | Function prototypes, initialization API, and evasion helpers |
SW4Syscalls.c | Runtime SSN resolution and helper function implementations |
SW4Syscalls.asm | MASM syscall stubs (for MSVC compiler) |
SW4Syscalls_stubs.c | GAS inline assembly stubs (for MinGW/Clang) |
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
TRUEon success,FALSEon 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
NTSTATUScodes
3. Evasion Helper Functions
Optional functions for AV/EDR bypass (generated based on command-line flags):SW4_PatchEtw()— Suppress user-mode ETW event deliverySW4_PatchAmsi()— Bypass AMSI scanningSW4_UnhookNtdll()— Remove inline hooks from ntdllSW4_AntiDebugCheck()— Detect debugger/analysis toolsSW4_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
--prefixflag to change (e.g.,--prefix MY→MY_NtAllocateVirtualMemory)
Return Values
NT syscall functions returnNTSTATUS codes:
Usage Patterns
Basic Initialization
With Evasion Features
Thread Safety
Once initialized, theSW4_Nt* syscall functions are thread-safe.
Compiler Support
The generated code supports:- MSVC (Microsoft Visual C++) — Uses MASM
.asmfiles - MinGW — Uses GAS inline assembly in
.cfiles - Clang — Uses GAS inline assembly in
.cfiles
--compiler flag when generating:
Architecture Support
| Architecture | Status | Notes |
|---|---|---|
| x64 | ✅ Full support | Primary target, all features available |
| x86 | ✅ Supported | 32-bit sysenter, embedded/egg methods only |
| WoW64 | ✅ Supported | 64-bit syscalls from 32-bit PE |
| ARM64 | ✅ Supported | Windows on ARM, svc #0 instruction |
--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
