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

Function get_function_address_by_ordinal

dumpy/dinvoke/src/lib.rs:182–191  ·  view source on GitHub ↗

Retrieves the address of an exported function from the specified module by its ordinal. In case that the function's address can't be retrieved, it will return 0. This functions internally calls LdrGetProcedureAddress. # Examples ``` let ntdll = dinvoke::get_module_base_address("ntdll.dll"); if ntdll != 0 { let ordinal: u32 = 8; let addr = dinvoke::get_function_address_ordinal(ntdll, 8); print

(module_base_address: isize, ordinal: u32)

Source from the content-addressed store, hash-verified

180/// }
181/// ```
182pub fn get_function_address_by_ordinal(module_base_address: isize, ordinal: u32) -> isize {
183
184 let ret = ldr_get_procedure_address(module_base_address, "", ordinal);
185
186 match ret {
187 Ok(r) => return r,
188 Err(_) => return 0,
189 }
190
191}
192
193/// Retrieves the address of an exported function from the specified module either by its name
194/// or by its ordinal number.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected