WinanDH
目的:
解决frida new主动调用so函数,调用次数过多出现程序崩溃问题。解决函数外部调用耗时过长问题
环境:
frida version == 12.8.0 、某汽车故障诊断设备
frida hook 部分测试代码
function FUNC_0006(){
var libUSAFORD_FILEPTR = Module.findExportByName("libUSAFORD_FILE.so", "LAUNCH_FORD_READFILE_FUNC_0026")
var MYlibUSAFORD_FILEPTR = new NativeFunction(libUSAFORD_FILEPTR, 'int', ['int','int','pointer']);
var out=Memory.alloc(0x600)
var zero="000"
for(var i=0xc400;i<0xc500;i++){
var dtccode=""
var index=""
if(i>0x7fff)
i-=0x10000
MYlibUSAFORD_FILEPTR(i*0x10000,0,out)
var data=new Uint8Array(ArrayBuffer.wrap(out, 8))
if(i>=0x0&&i<0x10)
console.log("dtccode:000"+(i.toString(16)).slice(-6)+"0000")
if(i>=0x10&&i<0x100)
console.log("dtccode:00"+(i.toString(16)).slice(-6)+"0000")
if(i>=0x100&&i<0x1000)
console.log("dtccode:0"+(i.toString(16)).slice(-6)+"0000")
if(i>=0x1000&&i<0x10000)
console.log("dtccode:"+(i.toString(16)).slice(-6)+"0000")
for(var m=7;m>3;m--){
index+=("00"+data[m].toString(16)).slice(-2)
}
console.log("index:"+index)
}
}