mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
parent
de5d102845
commit
5a5b60c31e
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user