Skip to content

Commit

Permalink
Fix: mentions of A9LH in user prompts
Browse files Browse the repository at this point in the history
Fixes #65
  • Loading branch information
d0k3 committed May 21, 2017
1 parent f670adb commit becf1e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion source/common/unittype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 1 addition & 2 deletions source/fs/fsperm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions source/nand/nandutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit becf1e3

Please sign in to comment.