Skip to content

Instantly share code, notes, and snippets.

@FrankSpierings
Created August 13, 2017 08:11
Show Gist options
  • Save FrankSpierings/fc2457170162203d5a4b856c36ecd090 to your computer and use it in GitHub Desktop.
Save FrankSpierings/fc2457170162203d5a4b856c36ecd090 to your computer and use it in GitHub Desktop.
Learning how to use Frida - Trying to modify Fruit Ninja
function unlockHack() {
playerObject = null
interceptPlayer = Interceptor.attach(Module.findExportByName("Fruit", "_ZN16FruitNinjaPlayer11GetInstanceEv"), {
onEnter: function(args) {
},
onLeave: function(result) {
playerObject = ptr(result.toInt32())
}
});
while (playerObject === null || playerObject == 0x1) {
console.log('.')
Thread.sleep(1)
}
interceptPlayer.detach()
console.log("Instance Object @ " + playerObject)
symbolName = "_ZN16FruitNinjaPlayer14UnlockAllModesEv"
symbol = Module.findExportByName('Fruit', symbolName)
console.log(symbolName + " @ " + symbol)
f = new NativeFunction(symbol, 'pointer', ['pointer'])
console.log(symbolName + "(" + playerObject +")")
console.log("Result: " + f(playerObject))
}
unlockHack()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment