Added support for exceptions.

This commit is contained in:
yellows8 2018-11-14 21:31:45 -05:00
parent 2d7e01f938
commit 96af83a70e
2 changed files with 22 additions and 1 deletions

View File

@ -9,7 +9,7 @@ const char* g_easterEgg = "Do you mean to tell me that you're thinking seriously
static char g_argv[2048];
static char g_nextArgv[2048];
static char g_nextNroPath[512];
static u64 g_nroAddr = 0;
u64 g_nroAddr = 0;
static u64 g_nroSize = 0;
static NroHeader g_nroHeader;
static bool g_isApplication = 0;

View File

@ -4,6 +4,9 @@
.type nroEntrypointTrampoline, %function
.align 2
.global __libnx_exception_entry
.type __libnx_exception_entry, %function
.cfi_startproc
nroEntrypointTrampoline:
@ -29,3 +32,21 @@ nroEntrypointTrampoline:
b loadNro
.cfi_endproc
.section .text.__libnx_exception_entry, "ax", %progbits
.align 2
.cfi_startproc
__libnx_exception_entry:
adrp x7, g_nroAddr
ldr x7, [x7, #:lo12:g_nroAddr]
cbz x7, __libnx_exception_entry_fail
br x7
__libnx_exception_entry_fail:
mov w0, #0xf801
bl svcReturnFromException
b .
.cfi_endproc