Skip to main content

spoof_syscall

Macro spoof_syscall 

Source
macro_rules! spoof_syscall {
    ($name:expr, $($arg:expr),* $(,)?) => { ... };
}
Expand description

Spoof an indirect syscall. SSN is resolved via dyncvoke_core’s Tartarus Gate, then the syscall instruction inside ntdll is dispatched under a fake stack.

§Examples

use spoof::{spoof_syscall, AsPointer};
let mut addr = core::ptr::null_mut::<core::ffi::c_void>();
let mut size = (1 << 12) as usize;
let status = spoof_syscall!(
    "NtAllocateVirtualMemory",
    -1isize,
    addr.as_ptr_mut(),
    0usize,
    size.as_ptr_mut(),
    0x3000u32,
    0x04u32
)? as i32;