Hi, I'm trying to hook the 'connect' method on windows but when I attach the injector, the process crash. I don't know how to have the log to debug it.
Here the following code of the dll:
use frida_gum::{
interceptor::{Interceptor, InvocationListener},
Gum, Module,
};
use std::{ffi::c_void, sync::LazyLock};
static GUM: LazyLock<Gum> = LazyLock::new(|| unsafe { Gum::obtain() });
pub struct ConnectListener;
impl InvocationListener for ConnectListener {
fn on_enter(&mut self, context: frida_gum::interceptor::InvocationContext) {
println!("[HOOK INJECTED] ENTER");
}
fn on_leave(&mut self, context: frida_gum::interceptor::InvocationContext) {
println!("[HOOK INJECTED] LEAVED");
}
}
#[no_mangle]
extern "C" fn hook(_user_data: *const c_void) {
let mut interceptor = Interceptor::obtain(&GUM);
let connect = Module::find_export_by_name(None, "connect").unwrap();
let mut listener = ConnectListener;
println!("HOOK PTR: {:x}", connect);
interceptor.attach(connect, &mut listener); // Crash at this moment
}
Edit: In JS everything is fine and the connect var is well defined
Hi, I'm trying to hook the 'connect' method on windows but when I attach the injector, the process crash. I don't know how to have the log to debug it.
Here the following code of the dll:
Edit: In JS everything is fine and the connect var is well defined