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

Function get_module_base_address

dumpy/dinvoke/src/lib.rs:30–44  ·  view source on GitHub ↗

Retrieves the base address of a module loaded in the current process. In case that the module can't be found in the current process, it will return 0. # Examples ``` let ntdll = dinvoke::get_module_base_address("ntdll.dll"); if ntdll != 0 { println!("The base address of ntdll.dll is 0x{:X}.", ntdll); } ```

(module_name: &str)

Source from the content-addressed store, hash-verified

28/// }
29/// ```
30pub fn get_module_base_address (module_name: &str) -> isize
31{
32 let process = Process::current();
33 let modules = process.module_list().unwrap();
34 for m in modules
35 {
36 if m.name().unwrap().to_lowercase() == module_name.to_ascii_lowercase()
37 {
38 let handle = m.handle();
39 return handle as isize;
40 }
41 }
42
43 0
44}
45
46/// Retrieves the address of an exported function from the specified module.
47///

Callers 15

load_library_aFunction · 0.85
open_processFunction · 0.85
close_handleFunction · 0.85
create_file_transactedFunction · 0.85
get_file_sizeFunction · 0.85
create_file_mappingFunction · 0.85
map_view_of_fileFunction · 0.85
unmap_view_of_fileFunction · 0.85
get_last_errorFunction · 0.85
set_handle_informationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected