Skip to content

Commit 23db866

Browse files
committed
Module: add find_global_export_by_name
1 parent cb116b4 commit 23db866

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

frida-gum/src/module.rs

+17
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ impl Module {
150150
}
151151
}
152152

153+
/// The absolute address of the export. In the event that no such export
154+
/// could be found, returns NULL.
155+
pub fn find_global_export_by_name(symbol_name: &str) -> Option<NativePointer> {
156+
let symbol_name = CString::new(symbol_name).unwrap();
157+
158+
let ptr = unsafe {
159+
gum_sys::gum_module_find_global_export_by_name(symbol_name.as_ptr().cast())
160+
as *mut c_void
161+
};
162+
163+
if ptr.is_null() {
164+
None
165+
} else {
166+
Some(NativePointer(ptr))
167+
}
168+
}
169+
153170
/// The absolute address of the symbol. In the event that no such symbol
154171
/// could be found, returns NULL.
155172
pub fn find_symbol_by_name(&self, symbol_name: &str) -> Option<NativePointer> {

0 commit comments

Comments
 (0)