-
Hi and thanks for this lib :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Ok so I've tried something like:
let address: usize = 0x141419130;
let target: unsafe extern "system" fn(u64, u64) -> bool = std::mem::transmute(address);
let target: fn(u64, u64) -> bool = std::mem::transmute(target);
// ✅ it goes till here, at least per the logs
if let Ok(detour) = GenericDetour::<fn(u64, u64) -> bool>::new(target, my_hook_func) {
// ❌ but it never reaches here
} Any help would be greatly appreciated :) |
Beta Was this translation helpful? Give feedback.
-
Welcome, I'd be happy to help you in the right direction!
|
Beta Was this translation helpful? Give feedback.
-
Also, what crate are you using that doesn't allow nightly? If the issue you're having is the first one and you can use static-detour, my helper crate retour-utils could be really helpful with the hook initialization process. |
Beta Was this translation helpful? Give feedback.
-
I'm gonna mark my own feedback as the answer, but your replies were truly helpful in solving it. I hope resolving this discussion won't shadow it from other people facing the same issue (usually people, myself included, tend to forget to look at "resolved" section for previous discussions). Your crate is really great, cheers 🙂 |
Beta Was this translation helpful? Give feedback.
indeed I'm on Windows and needed:
GetModuleHandleW
to get base address at runtime and cast its result as ausize
usize
too which turns out being0x1419130
insteadRawDetour
to avoid relying on nightlyunsafe extern "system" fn(u64, u64) -> bool
while it's actuallyuns…