Fix frida_code_file, initial config support
Signed-off-by: Dimitris Zervas <dzervas@dzervas.gr>
This commit is contained in:
@ -9,11 +9,11 @@ use crate::frida_handler::attach_pid as frida_attach_pid;
|
||||
pub extern "C" fn attach(pid: u32) {
|
||||
#[cfg(feature = "frida")]
|
||||
{
|
||||
let frida_code = env!("FRIDA_CODE");
|
||||
let frida_code = env!("FRIDA_CODE").replace("\\n", "\n");
|
||||
#[cfg(windows)]
|
||||
std::thread::spawn(move || frida_attach_pid(frida_code, pid));
|
||||
std::thread::spawn(move || frida_attach_pid(&frida_code, pid));
|
||||
#[cfg(not(windows))]
|
||||
frida_attach_pid(frida_code, pid);
|
||||
frida_attach_pid(&frida_code, pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
10
src/lib.rs
10
src/lib.rs
@ -39,11 +39,11 @@ mod tests {
|
||||
.arg("--target-dir")
|
||||
.arg("target/test_frida_on_load")
|
||||
.env("FRIDA_CODE", r#"
|
||||
const foo = Module.getExportByName(null, "mylib_foo");
|
||||
Interceptor.replace(foo, new NativeCallback(function () {
|
||||
console.log("replaced foo() called");
|
||||
return 40;
|
||||
}, "uint8", []));
|
||||
const foo = Module.getExportByName(null, "mylib_foo");
|
||||
Interceptor.replace(foo, new NativeCallback(function () {
|
||||
console.log("replaced foo() called");
|
||||
return 40;
|
||||
}, "uint8", []));
|
||||
"#)
|
||||
.status()
|
||||
.unwrap();
|
||||
|
Reference in New Issue
Block a user