Hook function in arm library on arm64 process in Frida

69 views Asked by At

I tried to hook function using Frida, the problem is the native library is only arm arch, arm64 is not inside apk.

var offset_of_md5_00011f14 = 0x1f14;
var dynamic_address_of_md5_00011f14 = Module.findBaseAddress("libnative.so").add(offset_of_md5_00011f14);
Interceptor.attach(dynamic_address_of_md5_00011f14, {
    onEnter: function (args) {
        console.log("Entered md5_00011f14");
        // this.context.x0=0x1;
    },
    onLeave: function (retval) {
        console.log("Exited md5_00011f14, retval:" + retval);
        // retval.replace(0x1);
    }
});
Revision: '0'
ABI: 'arm'
Timestamp: 2024-01-27 03:41:49+0100
pid: 12213, tid: 12213, name: com.example.app  >>> com.example.app <<<
uid: 10351
signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0xc0b41f16 (*pc=0x4c0fea6e)
    r0  00000000  r1  ffc6fb48  r2  cae65e88  r3  3f12ab92
    r4  00000000  r5  efc8e260  r6  f2b263c0  r7  65b46d6d
    r8  ffc6fb48  r9  ffc6fb6c  r10 ffc6fb58  r11 00002469
    ip  efc8ce00  sp  ffc6fb30  lr  c0b411d3  pc  c0b41f16

How can i force frida server for arm64 devices to use arm instructions to hook function?

0

There are 0 answers