Skip to content

Commit

Permalink
Module: add find_global_export_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 committed Jan 15, 2025
1 parent cb116b4 commit 23db866
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions frida-gum/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ impl Module {
}
}

/// The absolute address of the export. In the event that no such export
/// could be found, returns NULL.
pub fn find_global_export_by_name(symbol_name: &str) -> Option<NativePointer> {
let symbol_name = CString::new(symbol_name).unwrap();

let ptr = unsafe {
gum_sys::gum_module_find_global_export_by_name(symbol_name.as_ptr().cast())
as *mut c_void
};

if ptr.is_null() {
None
} else {
Some(NativePointer(ptr))
}
}

/// The absolute address of the symbol. In the event that no such symbol
/// could be found, returns NULL.
pub fn find_symbol_by_name(&self, symbol_name: &str) -> Option<NativePointer> {
Expand Down

0 comments on commit 23db866

Please sign in to comment.