From 57903f10b6784ef3fab1be3627b1f290a987dced Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Wed, 26 Jun 2024 13:10:53 +0300 Subject: [PATCH 1/4] bump frida version to 16.3.3 --- FRIDA_VERSION | 2 +- frida-gum-sys/FRIDA_VERSION | 2 +- frida-sys/FRIDA_VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FRIDA_VERSION b/FRIDA_VERSION index 89d04624..1dd56bff 100644 --- a/FRIDA_VERSION +++ b/FRIDA_VERSION @@ -1 +1 @@ -16.2.5 +16.3.3 diff --git a/frida-gum-sys/FRIDA_VERSION b/frida-gum-sys/FRIDA_VERSION index 89d04624..1dd56bff 100644 --- a/frida-gum-sys/FRIDA_VERSION +++ b/frida-gum-sys/FRIDA_VERSION @@ -1 +1 @@ -16.2.5 +16.3.3 diff --git a/frida-sys/FRIDA_VERSION b/frida-sys/FRIDA_VERSION index 89d04624..1dd56bff 100644 --- a/frida-sys/FRIDA_VERSION +++ b/frida-sys/FRIDA_VERSION @@ -1 +1 @@ -16.2.5 +16.3.3 From d801a43a43b0e43103a12b223585feb06cd5658a Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Wed, 26 Jun 2024 13:19:54 +0300 Subject: [PATCH 2/4] lint --- frida/src/script.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frida/src/script.rs b/frida/src/script.rs index 8eaa679f..a2f6be5c 100644 --- a/frida/src/script.rs +++ b/frida/src/script.rs @@ -90,7 +90,7 @@ impl<'a> Script<'a> { pub fn handle_message(&self, handler: &mut I) -> Result<()> { let message = CString::new("message").map_err(|_| Error::CStringFailed)?; unsafe { - let callback = Some(std::mem::transmute(call_on_message:: as *mut c_void)); + let callback = Some(std::mem::transmute::<*mut std::ffi::c_void, unsafe extern "C" fn()>(call_on_message:: as *mut c_void)); frida_sys::g_signal_connect_data( self.script_ptr as _, From ce24db47edfb7b41d20dce2583344dbb0e364fca Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Wed, 26 Jun 2024 15:04:17 +0300 Subject: [PATCH 3/4] .. --- frida/src/script.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frida/src/script.rs b/frida/src/script.rs index a2f6be5c..33d2affe 100644 --- a/frida/src/script.rs +++ b/frida/src/script.rs @@ -90,7 +90,10 @@ impl<'a> Script<'a> { pub fn handle_message(&self, handler: &mut I) -> Result<()> { let message = CString::new("message").map_err(|_| Error::CStringFailed)?; unsafe { - let callback = Some(std::mem::transmute::<*mut std::ffi::c_void, unsafe extern "C" fn()>(call_on_message:: as *mut c_void)); + let callback = Some(std::mem::transmute::< + *mut std::ffi::c_void, + unsafe extern "C" fn(), + >(call_on_message:: as *mut c_void)); frida_sys::g_signal_connect_data( self.script_ptr as _, From 0ae87294a5343d9b04287a1636bd976e4730a406 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Wed, 26 Jun 2024 15:28:08 +0300 Subject: [PATCH 4/4] lint is fun --- examples/gum/fast_interceptor/src/main.rs | 10 ++++++++-- examples/gum/hook_open/src/lib.rs | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/gum/fast_interceptor/src/main.rs b/examples/gum/fast_interceptor/src/main.rs index 6e4fc4e5..7c0ee77e 100644 --- a/examples/gum/fast_interceptor/src/main.rs +++ b/examples/gum/fast_interceptor/src/main.rs @@ -76,7 +76,10 @@ fn replace_normal() { let test_func_ptr = test_func as *mut c_void; let test_detour_ptr = test_detour as *mut c_void; unsafe { - *ORIGINAL_TEST.lock().unwrap().get_mut() = Some(std::mem::transmute( + *ORIGINAL_TEST.lock().unwrap().get_mut() = Some(std::mem::transmute::< + *mut libc::c_void, + extern "C" fn(*const i8) -> u32, + >( interceptor .replace( NativePointer(test_func_ptr), @@ -94,7 +97,10 @@ fn replace_fast() { let test_func_ptr = test_func as *mut c_void; let test_detour_ptr = test_detour as *mut c_void; unsafe { - *ORIGINAL_TEST.lock().unwrap().get_mut() = Some(std::mem::transmute( + *ORIGINAL_TEST.lock().unwrap().get_mut() = Some(std::mem::transmute::< + *mut libc::c_void, + extern "C" fn(*const i8) -> u32, + >( interceptor .replace_fast(NativePointer(test_func_ptr), NativePointer(test_detour_ptr)) .unwrap() diff --git a/examples/gum/hook_open/src/lib.rs b/examples/gum/hook_open/src/lib.rs index a85417e9..d4d00cfd 100644 --- a/examples/gum/hook_open/src/lib.rs +++ b/examples/gum/hook_open/src/lib.rs @@ -32,7 +32,10 @@ fn init() { let mut interceptor = Interceptor::obtain(&GUM); let open = Module::find_export_by_name(None, "open").unwrap(); unsafe { - *ORIGINAL_OPEN.lock().unwrap().get_mut() = Some(std::mem::transmute( + *ORIGINAL_OPEN.lock().unwrap().get_mut() = Some(std::mem::transmute::< + *mut libc::c_void, + unsafe extern "C" fn(*const i8, i32) -> i32, + >( interceptor .replace( open,