reFlutter icon indicating copy to clipboard operation
reFlutter copied to clipboard

How to read the dart virtual code instructions?

Open hpp0hpp opened this issue 2 years ago • 1 comments

Hi there

Seems the dart code is executed by VM, so even if we know the code offset, how can we read that? is there any guidance on how to read?

hpp0hpp avatar Apr 09 '22 13:04 hpp0hpp

is this the right way to hook the code using frida?

function hook_native(){ var libc_base = Module.findExportByName('libapp.so', '_kDartIsolateSnapshotInstructions');

var libc_hook = libc_base.add(0x0000000000110608);
// var libc_hook_addr = libc_base.add(0x1b9c);
console.log('libc_hook: ' + libc_hook);
console.log('libc_base: ' + libc_base);

Interceptor.attach(libc_hook, {
    onEnter: function(args) {
        for(var i = 0; i < args.length; i++){
            // console.log('arg[' + i + ']: ' + args[i]);
            console.log('arg[' + i + ']: ' );
        }
        },
    onLeave: function(retval) {
        console.log('retval: ' + retval);
        }

})

}

hpp0hpp avatar Apr 09 '22 16:04 hpp0hpp