| Crates.io | xhook-rs |
| lib.rs | xhook-rs |
| version | 0.2.0 |
| created_at | 2021-08-21 13:07:34.668576+00 |
| updated_at | 2021-08-21 13:14:31.517959+00 |
| description | A Rust binding for xHook |
| homepage | |
| repository | https://github.com/wuhx/xhook-rs |
| max_upload_size | |
| id | 440318 |
| size | 14,364 |
xHook bindings for Rust
use xhook_rs::*;
#[no_mangle]
pub extern "C" fn my_malloc(size: libc::size_t) -> *mut c_void {
println!("my malloc, {} bytes!", size);
unsafe { libc::malloc(size) }
}
fn main() {
xhook_register(".*\\.so$", "malloc", my_malloc as *const u8);
xhook_refresh(0);
unsafe {
//should call my_malloc here
let buf = libc::malloc(10);
println!("malloc: 10");
}
}