| Crates.io | minhook-detours-rs |
| lib.rs | minhook-detours-rs |
| version | 0.2.0 |
| created_at | 2025-07-31 07:18:53.803231+00 |
| updated_at | 2025-08-04 01:13:57.721232+00 |
| description | Rustic wrapper of minhook-detours-sys bindings. |
| homepage | |
| repository | https://github.com/cristeigabriela/minhook-detours-rs |
| max_upload_size | |
| id | 1774552 |
| size | 44,859 |
Available on crates.io.
Rustic wrapper of minhook-detours-sys bindings.
let mut guard = DetourGuard::new()?;
// The type of the hooked function, and of the detour.
type FunctionType = unsafe extern "system" fn(i32, i32) -> i64;
unsafe extern "system" fn add_two(lhs: i32, rhs: i32) -> i64 {
(lhs + rhs) as i64
}
unsafe extern "system" fn add_two_hook(lhs: i32, rhs: i32) -> i64 {
(lhs - rhs) as i64
}
let original = guard.create_and_enable_hook::<FunctionType>(add_two as _, add_two_hook as _)?;