IDA로 후킹할 사용자 함수의 상대 offset을 알아낸다.
frida로 앱 base주소를 얻고 offset을 더해준 주소에 후킹을 걸면 된다.
var module_base = Module.findBaseAddress('testapp'); // get base addr
var custom3_5fdfd4 = module_base.add(0x5fdfd4); // add function offset
Interceptor.attach(custom3_5fdfd4, {
onEnter: function (args) {
send("[*] custom3() called"); // before call
},
onLeave: function (retval) {
//send("[] custom3 ret: " + retval.toString()); // after call
}
});