Frida Crashed due to Bad acess erros
In one of the apps crash when i call a certain function frida code(part used) var targetClass = targetClassMethod.slice(0, delim); var targetMethod = targetClassMethod.slice(delim + 1, targetClassMethod.length); var hook = Java.use(targetClass); if(typeof hook[targetMethod]!= "undefined"){ var overloadCount = hook[targetMethod].overloads.length; send("methods "+targetClassMethod.toString()) for (var i = 0; i < overloadCount; i++) { hook[targetMethod].overloads[i].implementation = function () {
var retval;
send("enter "+targetClassMethod.toString())
try {
retval = this[targetMethod].apply(this, arguments); // might crash (Frida bug?)
// console.log("exit " +targetClassMethod.toString()+(new Date()).toString());
send("exit "+targetClassMethod.toString())
} catch (e) {
send("error "+targetClassMethod.toString())
// console.error(e);
}
return retval;
}
}
}
Frida error on_detached() reason: process-terminated crash: Crash(pid=10507, process_name="arch_disk_io_1", summary="Bad access due to protection failure", report=<540 bytes>, parameters={})
Build fingerprint: 'Android/vbox86p/vbox86p:9/PI/138:userdebug/test-keys' Revision: '0' ABI: 'x86' pid: 10507, tid: 10566, name: arch_disk_io_1 >>> com.starry.greenstash <<< signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xc26befc4 eax 00000000 ebx c3e3530c ecx e0c3ee08 edx 0000290b edi c7946e98 esi 00000000 ebp c26bf028 esp c26befb0 eip c305c732
backtrace: #00 pc 00898732 /data/local/tmp/re.frida.server/frida-agent-32.so (offset 0x61e000)
detached