JS 期望回调值

问题描述 投票:0回答:1

我给 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"), {

这是为什么?

javascript callback frida
1个回答
0
投票

你需要添加:

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() {}

});
© www.soinside.com 2019 - 2024. All rights reserved.