frida-python icon indicating copy to clipboard operation
frida-python copied to clipboard

how to pass a dict parameter from python to frida rpc javascript function?

Open 3xp10it opened this issue 5 years ago • 0 comments

I want to call a rpc function in frida js code,below is my rpc:

    rpc.exports = {
        signrequesturlwithparameters: function (param_dict,secret,signMethod) {	
 var result=ObjC.classes.GSNetworkUtils.signRequestUrlWithParameters_secret_signMethod_(param_dict,secret,signMethod);
		return String(ObjC.classes.NSString.stringWithString_(result));
        }
    };

and I want to use below python code to call the rpc function:

script.load()
signrequesturlwithparameters= getattr(script.exports, 'signrequesturlwithparameters')
_dict={"imsi":"46001","device_model":"iPhone7,2"}
secret="93AA27467E8"; 
signMethod="md5";
a=signrequesturlwithparameters(_dict,secret,signMethod)
print(a)

but it turns out run error,can I pass a dict from python to javasript rpc function in upon way? How should I modify the python or javascript code to make it work? Can someone help me?

3xp10it avatar Aug 13 '19 00:08 3xp10it