I'm trying to get the return value of a android native function call using Frida but with no success:
Interceptor.attach(Module.getExportByName('lib.so', 'Token'), {
onEnter: function(args) {
},
onLeave: function(retval) {
console.log(retval);
}
});
I know that the value is a bytearray but I can't find a way to read it from the native pointer.
Can anyone point me in the right direction? What should I do the get the value from retval? I already tried to use cast, but it didn't work.
thanks
var b = Java.use('[B') var buffer = Java.cast(retval, b);