From 4a3c9a0945515ff5b6e8277c2ab661b5007e7c9e Mon Sep 17 00:00:00 2001 From: rmc Date: Sun, 5 Nov 2023 01:28:19 -0400 Subject: [PATCH] Allow more types of titles to be installed - Allow dev apps with special TID to install (0x00030011) - Patch dev titles to be system - Add TwlNmenu to blacklist as it is potentially unsafe. See https://randommeaninglesscharacters.com/dsidev/twlnmenu.html - Allow all region content to be installed - Add all region PictoChat and Download Play to blacklist - Allow different region Launcher to be installed --- arm9/src/install.c | 30 +++++++++++++++++++++++++----- arm9/src/rom.c | 1 + arm9/src/storage.c | 5 +++-- arm9/src/titlemenu.c | 16 +++++++++------- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/arm9/src/install.c b/arm9/src/install.c index 1392ef8..269f07a 100644 --- a/arm9/src/install.c +++ b/arm9/src/install.c @@ -384,9 +384,11 @@ bool install(char* fpath, bool systemTitle) fixHeader = true; //title id must be one of these - if (h->tid_high == 0x00030004 || - h->tid_high == 0x00030005 || - h->tid_high == 0x00030015) + if (h->tid_high == 0x00030004 || // DSiWare + h->tid_high == 0x00030005 || // "unimportant" system titles + h->tid_high == 0x00030011 || // SRLs in the TWL SDK + h->tid_high == 0x00030015 || // system titles + h->tid_high == 0x00030017) // Launcher {} else { @@ -398,10 +400,23 @@ bool install(char* fpath, bool systemTitle) goto error; } + //patch dev titles to system titles on SysNAND. + // + //software released through the TWL SDK usually comes as a TAD and an SRL + //things like NandFiler have a TAD with a TID of 0x00030015 and an SRL with 0x00030011 + //the TAD is the installable version, so I'm assuming that 0x00030015 is what the console wants to see on NAND + //this changes the SRL TID accordingly + //not entirely sure why there's even any difference. I think the installed TAD and SRL the same as each other (minus the TID) + if(!sdnandMode && h->tid_high == 0x00030011) + { + h->tid_high = 0x00030015; + fixHeader = true; + } + //offer to patch system titles to normal DSiWare on SysNAND if(!sdnandMode && h->tid_high != 0x00030004) { - if(choiceBox("This is set as a system title,\nwould you like to patch it to\nbe a normal DSiWare?\n\nThis is safer, but invalidates\nRSA checks and may not work.\n\nIf the title is homebrew this isstrongly recommended.") == YES) + if(choiceBox("This is set as a system/dev\ntitle, would you like to patch\nit to be a normal DSiWare?\n\nThis is safer, but invalidates\nRSA checks and may not work.\n\nIf the title is homebrew this isstrongly recommended.") == YES) { h->tid_high = 0x00030004; fixHeader = true; @@ -430,12 +445,17 @@ bool install(char* fpath, bool systemTitle) tidLow == 0x484e4900 || // Nintendo DSi Camera tidLow == 0x484e4a00 || // Nintendo Zone tidLow == 0x484e4b00 // Nintendo DSi Sound + )) || (h->tid_high == 0x00030011 && ( + tidLow == 0x34544e00 // TwlNmenu (blocking due to -2011 and brick potential) )) || (h->tid_high == 0x00030015 && ( tidLow == 0x484e4200 || // System Settings tidLow == 0x484e4600 // Nintendo DSi Shop + )) || (h->tid_high == 0x00030017 && ( + tidLow == 0x484e4100 // Launcher ))) && ( (h->tid_low & 0xFF) == region || //only blacklist console region - (h->tid_low & 0xFF) == 'A' || //and 'A' (all region) + h->tid_low == 0x484e4541 || //and block specifically international PictoChat + h->tid_low == 0x484e4441 || //and Download Play for good measure region == 0 //if the region check failed somehow, blacklist everything )) { diff --git a/arm9/src/rom.c b/arm9/src/rom.c index 2d20728..fab9ddc 100644 --- a/arm9/src/rom.c +++ b/arm9/src/rom.c @@ -212,6 +212,7 @@ void printRomInfo(char const* fpath) { if (h->tid_high == 0x00030004 || h->tid_high == 0x00030005 || + h->tid_high == 0x00030011 || // TID for software in TWL SDK h->tid_high == 0x00030015 || h->tid_high == 0x00030017 || h->tid_high == 0x00030000) diff --git a/arm9/src/storage.c b/arm9/src/storage.c index a15a31d..827c286 100644 --- a/arm9/src/storage.c +++ b/arm9/src/storage.c @@ -436,11 +436,12 @@ int getMenuSlotsFree() { //Get number of open menu slots by subtracting the number of directories in the title folders //Find a better way to do this - const int NUM_OF_DIRS = 3; + const int NUM_OF_DIRS = 4; const char* dirs[] = { "00030004", "00030005", - "00030015" + "00030015", + "00030017" }; int freeSlots = getMenuSlots(); diff --git a/arm9/src/titlemenu.c b/arm9/src/titlemenu.c index 3b231c3..a367963 100644 --- a/arm9/src/titlemenu.c +++ b/arm9/src/titlemenu.c @@ -88,14 +88,15 @@ static void generateList(Menu* m) { if (!m) return; - const int NUM_OF_DIRS = 3; + const int NUM_OF_DIRS = 4; const char* dirs[] = { "00030004", "00030005", - "00030015" + "00030015", + "00030017" }; - const char* blacklist[3][6] = { + const char* blacklist[4][6] = { { // 00030004 NULL //nothing blacklisted }, @@ -110,6 +111,11 @@ static void generateList(Menu* m) { // 00030015 "484e42", // System Settings "484e46", // Nintendo DSi Shop + "34544e", // TwlNmenu (blocking due to -2011 and brick potential) + NULL + }, + { + "484e41", // Launcher NULL } }; @@ -152,10 +158,6 @@ static void generateList(Menu* m) sprintf(titleId, "%s%02x", blacklist[i][j], region); if (strcmp(titleId, ent->d_name) == 0) blacklisted = true; - - sprintf(titleId, "%s41", blacklist[i][j]); // also blacklist region 'a' - if (strcmp(titleId, ent->d_name) == 0) - blacklisted = true; } if (blacklisted) continue; }