frida/frida-rust

frida-gum: Cannot find function `g_object_unref` in crate `gum_sys` on aarch64-linux-android

SajjadPourali opened this issue · 1 comments

g_object_unref is not available for certain architectures.

#[cfg(not(any(target_os = "windows", target_os = "android", target_vendor = "apple",)))]
pub use _frida_g_object_unref as g_object_unref;

While in the following drops, it calls without performing the target check.

impl Drop for ModuleMap {
fn drop(&mut self) {
unsafe { gum_sys::g_object_unref(self.module_map as *mut c_void) }
}
}

impl<'a> Drop for Transformer<'a> {
fn drop(&mut self) {
unsafe { frida_gum_sys::g_object_unref(self.transformer as *mut c_void) }
}
}

impl<'a> Drop for Stalker<'a> {
fn drop(&mut self) {
unsafe { gum_sys::g_object_unref(self.stalker as *mut c_void) };
}
}

Thanks for your report. Care to take a stab at a PR to fix?