From ad9e00acaab08331fbd4b349fc9b15774c0b2647 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 29 Aug 2016 13:45:57 +0200 Subject: [PATCH] Add delay if a PIN was just verified and SAFE_MODE is being booted --- source/firm.c | 13 ++++++++++--- source/start.s | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/firm.c b/source/firm.c index 3fb9439..61c3ea0 100755 --- a/source/firm.c +++ b/source/firm.c @@ -35,7 +35,7 @@ #include "pin.h" #include "../build/injector.h" -extern u16 launchedFirmTIDLow[8]; //Defined in start.s +extern u16 launchedFirmTidLow[8]; //Defined in start.s static firmHeader *const firm = (firmHeader *)0x24000000; static const firmSectionHeader *section; @@ -75,14 +75,14 @@ void main(void) needConfig = readConfig(configPath) ? MODIFY_CONFIGURATION : CREATE_CONFIGURATION; //Determine if this is a firmlaunch boot - if(launchedFirmTIDLow[5] != 0) + if(launchedFirmTidLow[5] != 0) { if(needConfig == CREATE_CONFIGURATION) mcuReboot(); isFirmlaunch = true; //'0' = NATIVE_FIRM, '1' = TWL_FIRM, '2' = AGB_FIRM - firmType = launchedFirmTIDLow[7] == u'3' ? SAFE_FIRM : (FirmwareType)(launchedFirmTIDLow[5] - u'0'); + firmType = launchedFirmTidLow[7] == u'3' ? SAFE_FIRM : (FirmwareType)(launchedFirmTidLow[5] - u'0'); nandType = (FirmwareSource)BOOTCONFIG(0, 3); firmSource = (FirmwareSource)BOOTCONFIG(2, 1); @@ -149,6 +149,13 @@ void main(void) //Flag to tell loader to init SD configTemp |= 1 << 5; + + //If the PIN has been verified, wait to make it easier to press the SAFE_MODE combo + if(pinExists && !shouldLoadConfigMenu) + { + while(HID_PAD & PIN_BUTTONS); + chrono(2); + } } else { diff --git a/source/start.s b/source/start.s index f0f7f3c..3a5b4df 100644 --- a/source/start.s +++ b/source/start.s @@ -26,8 +26,8 @@ _start: b start -.global launchedFirmTIDLow -launchedFirmTIDLow: +.global launchedFirmTidLow +launchedFirmTidLow: .hword 0, 0, 0, 0, 0, 0, 0, 0 start: