Created
August 13, 2017 08:11
-
-
Save FrankSpierings/fc2457170162203d5a4b856c36ecd090 to your computer and use it in GitHub Desktop.
Learning how to use Frida - Trying to modify Fruit Ninja
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
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