Last active
February 18, 2019 18:11
-
-
Save roblabla/c4d656212e1069423d7d04b31db25858 to your computer and use it in GitHub Desktop.
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
// Call with x0 = hbabi, x1 = 0xFFFFFFFFFFFFFFFF, x2 = NRO address | |
// Starts running the NRO. Returns the exit code of the homebrew. | |
nroEntrypointTrampoline: | |
// TODO: Ideally, set up a new stack so NRO has a full stack to work with. | |
// Save r19-r29 | |
stp x19, x20, [sp,-0x10]! | |
stp x21, x22, [sp,-0x10]! | |
stp x23, x24, [sp,-0x10]! | |
stp x25, x26, [sp,-0x10]! | |
stp x27, x28, [sp,-0x10]! | |
stp x29, x30, [sp,-0x10]! | |
// Call NRO. | |
blr x2 | |
// Restore r19-r29 | |
ldp x29, x30, [sp], 0x10 | |
ldp x27, x28, [sp], 0x10 | |
ldp x25, x26, [sp], 0x10 | |
ldp x23, x24, [sp], 0x10 | |
ldp x21, x22, [sp], 0x10 | |
ldp x19, x20, [sp], 0x10 | |
// TODO: Ideally, reset old stack pointer | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment