我给 Frida 写了这个 JS 脚本
function find_func_address(lib,func)
{
Module.enumerateExports(lib,
{onMatch:
function(f){if(f.name==func){
console.log("address: " + f.address);}
return new NativePointer(f.address);
}});
}
Interceptor.attach(find_func_address("lib.so","myFunc"), {
onEnter: function (args) {
console.log("enter");
},
onLeave: function(retval) {
console.log("exit");
}
});
但是我收到错误:错误:预期回调值在线:
Interceptor.attach(find_func_address("lib.so","myFunc"), {
这是为什么?
你需要添加:
onComplete:函数(){}
代码完成:
function find_func_address(lib,func)
{
Module.enumerateExports(lib,
{onMatch:
function(f){if(f.name==func){
console.log("address: " + f.address);}
return new NativePointer(f.address);
}})
}
Interceptor.attach(find_func_address("lib.so","myFunc"), {
onEnter: function (args) {
console.log("enter");
},
onLeave: function(retval) {
console.log("exit");
},
onComplete: function() {}
});