From 5a5b60c31e91322062961144b63d78e5232424f7 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Sun, 21 May 2017 13:18:11 +0200 Subject: [PATCH] Fix: mentions of A9LH in user prompts Fixes #65 --- source/common/unittype.h | 3 ++- source/fs/fsperm.c | 3 +-- source/nand/nandutil.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/common/unittype.h b/source/common/unittype.h index cff5f7e..37f3f09 100644 --- a/source/common/unittype.h +++ b/source/common/unittype.h @@ -10,11 +10,12 @@ #define IS_DEVKIT ((*(vu8*) (0x01FFB800+0x19)) != 0x0) // see: https://3dbrew.org/wiki/CONFIG11_Registers +// (also returns true for sighaxed systems, maybe change the name later?) #define IS_A9LH ((*(vu32*) 0x101401C0) == 0) // https://www.3dbrew.org/wiki/CONFIG9_Registers // (actually checks for an unlocked OTP) #define IS_UNLOCKED (!((*(vu8*)0x10000000) & 0x2)) -// A9LH + unlocked = SigHax +// A9LH + unlocked == SigHax #define IS_SIGHAX (IS_A9LH && IS_UNLOCKED) diff --git a/source/fs/fsperm.c b/source/fs/fsperm.c index 3a1efb5..eed00f4 100644 --- a/source/fs/fsperm.c +++ b/source/fs/fsperm.c @@ -26,7 +26,6 @@ bool CheckWritePermissions(const char* path) { return false; // endless loop when mounted file inside image, but not possible // check drive type, get permission type - // TODO: handle entypoints other than A9LH (!!!) if (drvtype & DRV_SYSNAND) { u32 perms[] = { PERM_SYS_LVL0, PERM_SYS_LVL1, PERM_SYS_LVL2, PERM_SYS_LVL3 }; u32 lvl = (drvtype & (DRV_TWLNAND|DRV_ALIAS|DRV_CTRNAND)) ? 1 : 0; @@ -172,7 +171,7 @@ bool SetWritePermissions(u32 perm, bool add_perm) { return false; break; case PERM_SYS_LVL3: - if (!ShowUnlockSequence(6, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\n%s", IS_A9LH ? "your A9LH installation and/or\nBRICK your console!" : "essential system files and/or\nBRICK your console!")) + if (!ShowUnlockSequence(6, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\n%s", IS_SIGHAX ? "your B9S installation and/or\nBRICK your console!" : IS_A9LH ? "your A9LH installation and/or\nBRICK your console!" : "essential system files and/or\nBRICK your console!")) return false; break; case PERM_ALL: // not accessible from GM9 diff --git a/source/nand/nandutil.c b/source/nand/nandutil.c index 02b1cf1..4d244f0 100644 --- a/source/nand/nandutil.c +++ b/source/nand/nandutil.c @@ -203,11 +203,11 @@ u32 SafeRestoreNandDump(const char* path) { !ShowPrompt(true, "NAND dump corrupt or not from console.\nStill continue?")) return 1; if (!IS_A9LH) { - ShowPrompt(false, "Error: A9LH not detected."); + ShowPrompt(false, "Error: A9LH/B9S not detected."); return 1; } - if (!ShowUnlockSequence(5, "!WARNING!\n \nProceeding will overwrite the\nSysNAND with the provided dump.\n \n(A9LH will be left intact.)")) + if (!ShowUnlockSequence(5, "!WARNING!\n \nProceeding will overwrite the\nSysNAND with the provided dump.\n \n(A9LH/B9S will be left intact.)")) return 1; if (!SetWritePermissions(PERM_SYS_LVL1, true)) return 1;