Updated permissions system for non A9LH entrypoints

This commit is contained in:
d0k3 2017-02-22 18:43:57 +01:00
parent 5f252a3a34
commit d5e1b30425
2 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,7 @@
(((v) % (a)) ? ((v) + (a) - ((v) % (a))) : (v)) (((v) % (a)) ? ((v) + (a) - ((v) % (a))) : (v))
// GodMode9 version // GodMode9 version
#define VERSION "0.9.9.3" #define VERSION "0.9.9.4"
// input / output paths // input / output paths
#define INPUT_PATHS "0:", "0:/files9", "1:/rw/files9" #define INPUT_PATHS "0:", "0:/files9", "1:/rw/files9"

View File

@ -41,6 +41,9 @@ bool CheckWritePermissions(const char* path) {
for (u32 i = 0; (i < sizeof(path_lvl1) / sizeof(char*)) && (lvl < 1); i++) for (u32 i = 0; (i < sizeof(path_lvl1) / sizeof(char*)) && (lvl < 1); i++)
if (strncmp(path, path_lvl1[i], 256) == 0) lvl = 1; if (strncmp(path, path_lvl1[i], 256) == 0) lvl = 1;
} }
if (!CheckA9lh()) { // changed SysNAND permission levels on non-A9LH
if ((drvtype & DRV_CTRNAND) || (lvl == 2)) lvl = 3;
}
perm = perms[lvl]; perm = perms[lvl];
snprintf(area_name, 16, "SysNAND (lvl%lu)", lvl); snprintf(area_name, 16, "SysNAND (lvl%lu)", lvl);
} else if (drvtype & DRV_EMUNAND) { } else if (drvtype & DRV_EMUNAND) {
@ -169,7 +172,7 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
return false; return false;
break; break;
case PERM_SYS_LVL3: case PERM_SYS_LVL3:
if (!ShowUnlockSequence(5, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\nyour A9LH installation and\nBRICK your console!")) if (!ShowUnlockSequence(5, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\n%s", CheckA9lh() ? "your A9LH installation and/or\nBRICK your console!" : "essential system files and/or\nBRICK your console!"))
return false; return false;
break; break;
case PERM_ALL: // maybe get rid of this (???) case PERM_ALL: // maybe get rid of this (???)