MCPcopy Create free account
hub / github.com/Kudaes/Dumpy / nt_open_process

Function nt_open_process

dumpy/dinvoke/src/lib.rs:774–788  ·  view source on GitHub ↗

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

(handle: *mut HANDLE, desired_access: u32, attributes: *mut OBJECT_ATTRIBUTES, client_id: *mut CLIENT_ID)

Source from the content-addressed store, hash-verified

772///
773/// It will return the NTSTATUS value returned by the call.
774pub fn nt_open_process(handle: *mut HANDLE, desired_access: u32, attributes: *mut OBJECT_ATTRIBUTES, client_id: *mut CLIENT_ID) -> i32 {
775
776 unsafe
777 {
778 let ret;
779 let func_ptr: data::NtOpenProcess;
780 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
781 dynamic_invoke!(ntdll,&lc!("NtOpenProcess"),func_ptr,ret,handle,desired_access,attributes,client_id);
782
783 match ret {
784 Some(x) => return x,
785 None => return -1,
786 }
787 }
788}
789
790/// Dynamically calls NtDuplicateObject.
791///

Callers 1

dumpFunction · 0.85

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected