Skip to content

Commit

Permalink
lint is fun
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Jun 26, 2024
1 parent ce24db4 commit 0ae8729
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions examples/gum/fast_interceptor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion examples/gum/hook_open/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0ae8729

Please sign in to comment.