Closed alongj closed 1 year ago
some source code of __open in io_frida.c . where i can find the R2FRIDA_AGENT_SCRIPT
...
char *r2f_as = r_sys_getenv ("R2FRIDA_AGENT_SCRIPT");
if (r2f_as) {
code_malloc_data = r_file_slurp (r2f_as, &code_size);
code_buf = code_malloc_data;
if (!code_buf) {
R_LOG_ERROR ("Cannot slurp R2FRIDA_AGENT_SCRIPT");
}
free (r2f_as);
}
if (code_buf == NULL) {
code_size = sizeof (r_io_frida_agent_code);
code_malloc_data = malloc (code_size + 1);
if (!code_malloc_data) {
R_LOG_ERROR ("Cannot allocate enough memory for the agent");
goto error;
}
memcpy (code_malloc_data, r_io_frida_agent_code, code_size);
code_malloc_data[code_size] = 0;
code_buf = code_malloc_data;
}
rf->script = frida_session_create_script_sync (rf->session, code_buf, options, rf->cancellable, &error);
free (code_malloc_data);
if (error) {
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
R_LOG_ERROR ("Cannot create script: %s", error->message);
}
goto error;
}
...
dupe of https://github.com/nowsecure/r2frida/issues/444 (there are 5 issues about r2frida not working on windows) when thats a known issue and probably a bug in frida, i'm slowly investigating the issue but i didnt managed to find the reason why the compiled scripts are not parsed properly by frida inside r2frida.
_agent.txt
rf->script = frida_session_create_script_sync (rf->session, code_buf, options, rf->cancellable, &error);
The attached file is a memory dump for code_buff. Is the parameter content correct?