Expand description
PEB walking, export parsing, Tartarus Gate syscalls, and nt_* wrappers.
This is the default dyncvoke backend (feature = "syscall"). The usual
entry points are syscall!, do_syscall!, resolve_syscall,
get_module_base_address, and get_function_address.
Indirect syscalls:
resolve_syscallfinds the ntdll stub, extracts the SSN (Hell’s / Halo’s / Tartarus Gate), and locates asyscall; retgadget.syscall!does that and dispatches in one step.do_syscall!dispatches a cached(ssn, addr)pair with no extra resolution.
ⓘ
use dyncvoke_core::syscall;
let status = syscall!("NtClose", handle).unwrap() as i32;Module lookup walks PEB->Ldr->InLoadOrderModuleList. It does not call
EnumProcessModules or GetModuleHandle.
Re-exports§
pub use sys::extract_ssn;pub use sys::get_syscall_address;pub use sys::resolve_syscall;pub use sys::SyscallError;
Modules§
- peb
- In-process PEB / LDR walk. Avoids EnumProcessModules / GetModuleBaseNameW.
- sys
- Tartarus Gate SSN resolution and syscall-instruction location.
Macros§
- do_
syscall x86-64 - Low-level escape hatch when you already have a resolved
(ssn, addr). - dynamic_
invoke - Dynamically calls an exported function from the specified module.
- syscall
x86-64 - Resolve a Zw/Nt syscall by name (Tartarus Gate) and dispatch via the variadic Hell’s Hall gateway.
Structs§
Constants§
Functions§
- GetCurrent
Process ⚠ - add_
vectored_ exception_ handler - Dynamically calls AddVectoredExceptionHandler.
- breakpoint_
handler ⚠x86-64 - This function acts as an Exception Handler, and should be combined with a hardware breakpoint.
- call_
module_ entry_ point - Calls the module’s entry point with the option DLL_ATTACH_PROCESS.
- close_
handle - Closes a HANDLE object.
- create_
file_ a - Dynamically calls CreateFileA. On success, it returns a valid handle to the specified file. Otherwise, a null handle is returned.
- create_
file_ mapping_ w - Dynamically calls CreateFileMappingW.
- do_
syscall ⚠x86-64 - Hell’s Hall variadic syscall dispatcher.
- enum_
process_ modules - Dynamically calls EnumProcessModules.
- fork
- Call NtCreateUserProcess to fork the current process. Inheritable objects are inherited by the child process (PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT).
- free_
library - Frees the loaded dll. The function expects the module’s base address.
- get_
api_ mapping - get_
file_ size - Dynamically calls GetFileSize. It returns either the specified file size (success) or 0 (an error ocurred).
- get_
function_ address - Retrieves the address of an exported function from the specified module.
- get_
function_ address_ by_ ordinal - Retrieves the address of an exported function from the specified module by its ordinal.
- get_
last_ error - Read
TEB.LastErrorValue(gs:[0x68]x64 /fs:[0x34]x86). - get_
module_ base_ address - Retrieves the base address of a module loaded in the current process.
- get_
module_ base_ address_ h - Hash-based module lookup. Pass the djb2 hash of the lowercased ascii name
(compute via
peb::hash_name). The plaintext never lands in.rdata. - get_
module_ base_ name_ w - Dynamically calls GetModuleBaseNameW.
- get_
module_ file_ name_ ex_ w - Dynamically calls GetModuleBaseNameW.
- get_
module_ handle_ ex_ a - Dynamically calls GetModuleHandleExA.
- get_
system_ info - Dynamically calls GetSystemInfo.
- hook_
function - Patch
src_addresswith a trampoline todst_address. Original bytes are stored sounhook_functioncan restore them. - ldr_
get_ procedure_ address - Retrieves the address of an exported function from the specified module either by its name or by its ordinal number.
- load_
library_ a - Dynamically calls LoadLibraryA.
- load_
library_ a_ tp - Uses the Thread Pool to call LoadLibraryA.
- local_
alloc - Dynamically calls LocalAlloc.
- map_
view_ of_ file - Dynamically calls MapViewOfFile.
- nt_
allocate_ virtual_ memory x86-64 - Dynamically calls NtAllocateVirtualMemory.
- nt_
create_ section - Dynamically calls NtCreateSection.
- nt_
create_ thread_ ex x86-64 - Dynamically calls NtCreateThreadEx.
- nt_
create_ user_ process - Dynamically calls NtCreateUserProcess.
- nt_
map_ view_ of_ section - Dynamically calls NtMapViewOfSection.
- nt_
open_ file - Dynamically calls NtOpenFile.
- nt_
open_ process x86-64 - Dynamically calls NtOpenProcess.
- nt_
protect_ virtual_ memory x86-64 - Dynamically calls NtProtectVirtualMemory.
- nt_
query_ information_ file - Dynamically calls NtQueryInformationFile.
- nt_
query_ information_ process - Dynamically calls NtQueryInformationProcess.
- nt_
query_ information_ thread - Dynamically calls NtQueryInformationThread.
- nt_
read_ virtual_ memory - Dynamically calls NtReadVirtualMemory.
- nt_
sleep_ millis - Block the current thread for
msmilliseconds via NtDelayExecution. - nt_
write_ virtual_ memory x86-64 - Dynamically calls NtWriteVirtualMemory.
- open_
process - Opens a HANDLE to a process.
- open_
thread - Opens a HANDLE to a thread.
- rollback_
transaction - Dynamically calls RollbackTransaction.
- rtl_
adjust_ privilege - Dynamically calls RtlAdjustPrivilege.
- rtl_
init_ unicode_ string - Dynamically calls RtlInitUnicodeString.
- rtl_
zero_ memory - Dynamically calls RtlZeroMemory.
- set_
hardware_ breakpoint x86-64 - It sets a hardware breakpoint on a certain memory address.
- set_
unhandled_ exception_ filter - Dynamically calls SetUnhandledExceptionFilter.
- tls_
alloc - Dynamically calls TlsAlloc.
- tls_
get_ value - Dynamically calls TlsGetValue.
- tls_
set_ value - Dynamically calls TlsSetValue.
- unhook_
function - Restore bytes previously overwritten by
hook_function. - unmap_
view_ of_ file - Dynamically calls UnmapViewOfFile.
- use_
hardware_ breakpoints x86-64 - Enables or disables the use of exception handlers in combination with hardware breakpoints.
- virtual_
free - Dynamically calls VirtualFree.
- virtual_
query_ ex - Dynamically calls VirtualQueryEx.