redhook icon indicating copy to clipboard operation
redhook copied to clipboard

Dynamic function call interposition / hooking (LD_PRELOAD) for Rust

Results 14 redhook issues
Sort by recently updated
recently updated
newest added

I'm trying to `hook!` `printf` but the `hook!` macro doesn't allow it: ``` src/lib.rs:25:45: 25:48 error: expected ident, found ... src/lib.rs:25 unsafe fn printf(format: *const c_char, ...) -> c_int =>...

From looking into open issues and activity, it seems the library is no longer maintained. Is there any suitable replacement / alternative we could use?

Hi, I was trying to build a shared library with the `aarch64-linux-android` target (for use with Termux) and it didn't work because `ld_preload` module is enabled for `gnu` targets only....

This seems like the right thing to do (cf. [Rust RFC 1510](https://github.com/rust-lang/rfcs/blob/master/text/1510-cdylib.md)) but when I tried it it didn't export my hook function. ``` $ nm -D examples/readlinkspy/target/debug/libreadlinkspy.so w __cxa_finalize...

could be useful. add to examples? ```rust // we need Arc and Mutex to make this thread-safe use std::sync::Arc; use std::sync::Mutex; use std::collections::HashMap; struct State { map: HashMap, init_done: bool,...

i want to intercept the `statx` call by node. problem is, instead of `statx(...)`, node calls `syscall(332, ...)` [node/deps/uv/src/unix/linux-syscalls.c](https://github.com/nodejs/node/blob/master/deps/uv/src/unix/linux-syscalls.c) ```c #ifndef __NR_statx # if defined(__x86_64__) # define __NR_statx 332 #...

can we add this somehow? im new to rust, so i hope there is a shorter way ... convert string from C to Rust ```rust unsafe fn str_of_chars(cstr: *const libc::c_char)...

this has no effect ```rust hook! { unsafe fn main( argc: libc::c_int, argv: *const *const libc::c_char, envp: *const *const libc::c_char ) -> libc::c_int => my_main { println!("my_main"); let exit_code =...

Hi, I'm trying to use redhook to hook memory allocation functions, including `malloc` and `calloc`. The problem is that the hook implementation ends up allocating memory on the heap. This...

Change real_fn to be defined in mod instead of impl, so it is exported while building as cdylib. This allows building crates using redhook not only as dylib but as...