MCPcopy Create free account
hub / github.com/Kudaes/Split / nt_allocate_virtual_memory

Function nt_allocate_virtual_memory

dinvoke/src/lib.rs:694–708  ·  view source on GitHub ↗

Dynamically calls NtAllocateVirtualMemory. It will return the NTSTATUS value returned by the call.

(handle: HANDLE, base_address: *mut PVOID, zero_bits: usize, size: *mut usize, allocation_type: u32, protection: u32)

Source from the content-addressed store, hash-verified

692///
693/// It will return the NTSTATUS value returned by the call.
694pub fn nt_allocate_virtual_memory (handle: HANDLE, base_address: *mut PVOID, zero_bits: usize, size: *mut usize, allocation_type: u32, protection: u32) -> i32 {
695
696 unsafe
697 {
698 let ret;
699 let func_ptr: data::NtAllocateVirtualMemory;
700 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
701 dynamic_invoke!(ntdll,&lc!("NtAllocateVirtualMemory"),func_ptr,ret,handle,base_address,zero_bits,size,allocation_type,protection);
702
703 match ret {
704 Some(x) => return x,
705 None => return -1,
706 }
707 }
708}
709
710/// Dynamically calls NtProtectVirtualMemory.
711///

Callers 1

mainFunction · 0.85

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected