commit
1acdfb20df
@ -149,41 +149,6 @@ function hookSecret() {
|
||||
}
|
||||
});
|
||||
}
|
||||
rpc.exports = {
|
||||
callsecretfunction: callSecretFun,
|
||||
hooksecretfunction: hookSecret
|
||||
};console.log("Script loaded successfully ");
|
||||
var instances_array = [];
|
||||
function callSecretFun() {
|
||||
Java.perform(function () {
|
||||
if (instances_array.length == 0) { // if array is empty
|
||||
Java.choose("com.example.a11x256.frida_test.my_activity", {
|
||||
onMatch: function (instance) {
|
||||
console.log("Found instance: " + instance);
|
||||
instances_array.push(instance)
|
||||
console.log("Result of secret func: " + instance.secret());
|
||||
},
|
||||
onComplete: function () { }
|
||||
|
||||
});
|
||||
}
|
||||
else {//else if the array has some values
|
||||
console.log("Result of secret func: " + instances_array[0].secret());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function hookSecret() {
|
||||
Java.perform(function () {
|
||||
var my_class = Java.use("com.example.a11x256.frida_test.my_activity");
|
||||
var string_class = Java.use("java.lang.String");
|
||||
my_class.secret.overload().implementation = function(){
|
||||
var my_string = string_class.$new("THIS IS FAKE BB");
|
||||
return my_string;
|
||||
}
|
||||
});
|
||||
}
|
||||
rpc.exports = {
|
||||
callsecretfunction: callSecretFun,
|
||||
hooksecretfunction: hookSecret
|
||||
|
Loading…
Reference in New Issue
Block a user