How jthuraisamy/syswhispers works
What this project is (type + purpose)
SysWhispers is a single-purpose CLI code generator (Python script) that produces two artifacts for Windows x64 implants/tools:
• a C/C++ header (.h) containing syscall prototypes + needed typedefs
• an x64 MASM assembly file (.asm) implementing syscall stubs that invoke syscalls directly (bypassing user-mode API hooks in ntdll.dll)
It targets core kernel (ntoskrnl.exe) syscalls across Windows XP → Windows 10 19042, and intentionally doesn’t call RtlGetVersion; it reads OS info in assembly via PEB access so a single stub can support multiple versions.
What the file tree implies architecturally
Top-level:
• syswhispers.py
The entire “application” entrypoint: CLI arg parsing, selection of syscalls, and file generation.
• data/ (all of SysWhispers’ “knowledge base”)
• prototypes.json — function prototypes (names, args, return types)
• typedefs.json — typedefs required by prototypes
• syscall_numbers.json — mapping of syscall → numbers per Windows version/build
• example-output/
This strongly suggests a data-driven generator: the “logic” is in Python, the “content” is in JSON.
Key behaviors from README to capture
• Inputs: presets (--preset all/common), explicit functions (--functions), versions (--versions), output name (-o/--out-file)
• Core processing:
• choose syscall set (preset/function list)
• filter/version-compat resolve (based on versions requested)
• lookup numbers (from syscall_numbers.json)
• merge prototypes and typedefs (from JSON)
• emit .h + .asm
• Output consumption:
• imported into a Visual Studio x64 project
• MASM build customization enabled
• Runtime effect (why it exists):
• generated stubs call syscalls directly rather than via hooked user-mode APIs
• OS version handling done by PEB query in assembly
User / Operator
• Provides CLI args: --preset, --functions, --versions, -o
SysWhispers CLI (syswhispers.py)
• Argument Parser / Options
• Syscall Selection
• “Preset resolver” (common/all)
• “Function list resolver”
• Version Compatibility Filter
• Metadata Loader
• loads data/syscall_numbers.json
• loads data/prototypes.json
• loads data/typedefs.json
• Code Generator / Emitter
• Header emitter (*.h)
• ASM emitter (*.asm)
Data Files (JSON)
• Prototypes DB (prototypes.json)
• Typedefs DB (typedefs.json)
• Syscall Numbers Matrix (syscall_numbers.json)
Outputs
• syscalls.h (or syscalls_*.h)
• syscalls.asm (or syscalls_*.asm)
Downstream Consumer
• “Implant / C++ Project (VS x64 + MASM)”
• shows include of .h and compilation of .asm
Generated Stub Layer
• “SysWhispers syscall stubs (ASM)”
• “PEB-based OS version detection”
• “select correct syscall number per version”
• “invoke syscall instruction”
Windows User Mode Context
• PEB (explicit object)
Kernel
• ntoskrnl.exe (syscall dispatcher / system service)
• Target syscalls (e.g., NtAllocateVirtualMemory, etc.)
Architectural patterns/principles to call out
• Data-driven code generation: JSON “databases” drive emitted code.
• Separation of concerns:
• metadata (JSON) vs generator (Python) vs emitted artifacts (C header/ASM)
• Cross-version abstraction:
• one generated API surface supports multiple Windows versions
• Evasion tactic:
• bypass user-mode hooks by not using the hooked API path
Operator
→ 2. SysWhispers CLI (syswhispers.py)
Runtime section: Implant calls generated functions
→ ASM stub (PEB query + syscall number selection)
→ syscall transition
→ Kernel (ntoskrnl.exe)