Created
January 20, 2023 13:30
-
-
Save DiegoCaridei/9c21502563f48b062509de284aee8b0d to your computer and use it in GitHub Desktop.
Frida demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bin = Process.enumerateModulesSync()[0] | |
Module.enumerateSymbolsSync(bin.name) | |
Interceptor.attach(ptr(0x10368deb0),{ | |
onEnter(args){ | |
console.log("The function add is invoke") | |
console.log("Arg 0", args[0].toInt32()) | |
console.log("Arg 1", args[1].toInt32()) | |
} | |
}) | |
Interceptor.attach(ptr(0x10c0bceb0),{ | |
onEnter(args){ | |
console.log("The function add is invoke") | |
console.log("Arg 0", args[0].toInt32()) | |
console.log("Arg 1", args[1].toInt32()) | |
}, | |
onLeave(retval){ | |
return retval.replace(10) | |
} | |
}) | |
var add = Module.findExportByName(null, 'add'); | |
Interceptor.replace(add, new NativeCallback(function (arg1,arg2) { | |
console.log(arg1,arg2) | |
return arg1 * arg2; | |
}, 'int', ['int', 'int'])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment