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,