From 083806bfc9b0c76e5975c1904987f5ee018f00b5 Mon Sep 17 00:00:00 2001 From: Aurora Date: Fri, 23 Sep 2016 14:34:20 +0200 Subject: [PATCH] Fix decrypted ARM9bin support for LGY FIRMs --- source/crypto.c | 5 +++-- source/screen.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/crypto.c b/source/crypto.c index cc1a540..82fff5b 100755 --- a/source/crypto.c +++ b/source/crypto.c @@ -417,7 +417,8 @@ void kernel9Loader(u8 *arm9Section) break; } - bool needToDecrypt = *(u32 *)(arm9Section + 0x800) != 0x47704770; + u32 startOfArm9Bin = *(u32 *)(arm9Section + 0x800); + bool needToDecrypt = startOfArm9Bin != 0x47704770 && startOfArm9Bin != 0xB0862000; if(!isDevUnit && (k9lVersion == 2 || (k9lVersion == 1 && needToDecrypt))) { @@ -431,7 +432,7 @@ void kernel9Loader(u8 *arm9Section) { u8 arm9BinSlot; - if(k9lVersion == 0) arm9BinSlot = 0x15; + if(!k9lVersion) arm9BinSlot = 0x15; else { arm9BinSlot = 0x16; diff --git a/source/screen.c b/source/screen.c index 09716b9..f49314d 100644 --- a/source/screen.c +++ b/source/screen.c @@ -317,6 +317,6 @@ void initScreens(void) needToSetup = false; } - swapFramebuffers(false); clearScreens(true, true, false); + swapFramebuffers(false); } \ No newline at end of file