Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JoasASantos/SysWhispers4/llms.txt
Use this file to discover all available pages before exploring further.
Overview
SysWhispers4 provides direct syscall wrappers for Windows NT memory management functions. These bypass user-mode hooks onkernel32.dll and ntdll.dll functions like VirtualAllocEx, WriteProcessMemory, etc.
NtAllocateVirtualMemory
Allocates virtual memory within a process.Parameters
Handle to the target process. Use
GetCurrentProcess() for local allocation, or a handle from SW4_NtOpenProcess() for remote allocation.Pointer to a variable that receives the base address of the allocated region. Set to
NULL to let the system choose the address.Number of high-order address bits that must be zero. Use
0 for no restriction.Pointer to the size (in bytes) of the region to allocate. Rounded up to page boundary. On success, receives the actual allocated size.
Type of allocation. Common values:
MEM_COMMIT(0x1000) — Commit pagesMEM_RESERVE(0x2000) — Reserve address spaceMEM_COMMIT | MEM_RESERVE(0x3000) — Allocate and commit
Memory protection. Common values:
PAGE_READONLY(0x02)PAGE_READWRITE(0x04)PAGE_EXECUTE(0x10)PAGE_EXECUTE_READ(0x20)PAGE_EXECUTE_READWRITE(0x40)
Returns
STATUS_SUCCESS(0x00000000) on successSTATUS_ACCESS_DENIED(0xC0000022) if process handle lacks accessSTATUS_INVALID_PARAMETER(0xC000000D) for invalid parameters
Example
NtAllocateVirtualMemoryEx
Extended version ofNtAllocateVirtualMemory with additional parameters (Windows 10+).
Parameters
Similar toNtAllocateVirtualMemory, with added support for extended parameters (e.g., NUMA node affinity).
Pointer to array of
MEM_EXTENDED_PARAMETER structures (or NULL).Number of extended parameters (use
0 if none).NtFreeVirtualMemory
Frees virtual memory allocated byNtAllocateVirtualMemory.
Parameters
Handle to the process.
Pointer to the base address to free.
Pointer to size. For
MEM_RELEASE, must be 0. For MEM_DECOMMIT, specifies size.MEM_DECOMMIT(0x4000) — Decommit pages (keep reservation)MEM_RELEASE(0x8000) — Release entire region
Example
NtWriteVirtualMemory
Writes data to virtual memory in a process.Parameters
Handle to the target process with
PROCESS_VM_WRITE access.Starting address in the target process where data will be written.
Pointer to the data to write.
Number of bytes to write.
Optional pointer to receive the actual number of bytes written. Can be
NULL.Example: Remote Shellcode Injection
NtReadVirtualMemory
Reads data from virtual memory in a process.Parameters
Handle with
PROCESS_VM_READ access.Starting address to read from.
Pointer to buffer that receives the data.
Number of bytes to read.
Optional pointer to receive actual bytes read. Can be
NULL.Example
NtProtectVirtualMemory
Changes memory protection on a region.Parameters
Handle with
PROCESS_VM_OPERATION access.Pointer to base address of the region.
Pointer to size of the region.
New protection value (e.g.,
PAGE_EXECUTE_READ).Pointer to variable that receives the previous protection value.
Example: RWX → RX After Write
NtQueryVirtualMemory
Retrieves information about a memory region.Parameters
Type of information:
MemoryBasicInformation(0) — ReturnsMEMORY_BASIC_INFORMATION
Pointer to buffer that receives information.
Size of the buffer.
Example
NtSetInformationVirtualMemory
Sets virtual memory information (Windows 10+).Use Cases
- Prefetch memory —
VmPrefetchInformation - Set page priority — Performance optimization
Complete Injection Example
Combining memory functions for classic remote injection:Next Steps
Process & Thread Functions
Open processes, create threads, suspend/resume
File Functions
NT file I/O via syscalls
