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
This commit is contained in:
rmc 2023-11-05 01:28:19 -04:00
parent a794c64424
commit 4a3c9a0945
No known key found for this signature in database
GPG Key ID: 5633EC10309D77D1
4 changed files with 38 additions and 14 deletions

View File

@ -384,9 +384,11 @@ bool install(char* fpath, bool systemTitle)
fixHeader = true; fixHeader = true;
//title id must be one of these //title id must be one of these
if (h->tid_high == 0x00030004 || if (h->tid_high == 0x00030004 || // DSiWare
h->tid_high == 0x00030005 || h->tid_high == 0x00030005 || // "unimportant" system titles
h->tid_high == 0x00030015) h->tid_high == 0x00030011 || // SRLs in the TWL SDK
h->tid_high == 0x00030015 || // system titles
h->tid_high == 0x00030017) // Launcher
{} {}
else else
{ {
@ -398,10 +400,23 @@ bool install(char* fpath, bool systemTitle)
goto error; 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 //offer to patch system titles to normal DSiWare on SysNAND
if(!sdnandMode && h->tid_high != 0x00030004) 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; h->tid_high = 0x00030004;
fixHeader = true; fixHeader = true;
@ -430,12 +445,17 @@ bool install(char* fpath, bool systemTitle)
tidLow == 0x484e4900 || // Nintendo DSi Camera tidLow == 0x484e4900 || // Nintendo DSi Camera
tidLow == 0x484e4a00 || // Nintendo Zone tidLow == 0x484e4a00 || // Nintendo Zone
tidLow == 0x484e4b00 // Nintendo DSi Sound tidLow == 0x484e4b00 // Nintendo DSi Sound
)) || (h->tid_high == 0x00030011 && (
tidLow == 0x34544e00 // TwlNmenu (blocking due to -2011 and brick potential)
)) || (h->tid_high == 0x00030015 && ( )) || (h->tid_high == 0x00030015 && (
tidLow == 0x484e4200 || // System Settings tidLow == 0x484e4200 || // System Settings
tidLow == 0x484e4600 // Nintendo DSi Shop 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) == 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 region == 0 //if the region check failed somehow, blacklist everything
)) ))
{ {

View File

@ -212,6 +212,7 @@ void printRomInfo(char const* fpath)
{ {
if (h->tid_high == 0x00030004 || if (h->tid_high == 0x00030004 ||
h->tid_high == 0x00030005 || h->tid_high == 0x00030005 ||
h->tid_high == 0x00030011 || // TID for software in TWL SDK
h->tid_high == 0x00030015 || h->tid_high == 0x00030015 ||
h->tid_high == 0x00030017 || h->tid_high == 0x00030017 ||
h->tid_high == 0x00030000) h->tid_high == 0x00030000)

View File

@ -436,11 +436,12 @@ int getMenuSlotsFree()
{ {
//Get number of open menu slots by subtracting the number of directories in the title folders //Get number of open menu slots by subtracting the number of directories in the title folders
//Find a better way to do this //Find a better way to do this
const int NUM_OF_DIRS = 3; const int NUM_OF_DIRS = 4;
const char* dirs[] = { const char* dirs[] = {
"00030004", "00030004",
"00030005", "00030005",
"00030015" "00030015",
"00030017"
}; };
int freeSlots = getMenuSlots(); int freeSlots = getMenuSlots();

View File

@ -88,14 +88,15 @@ static void generateList(Menu* m)
{ {
if (!m) return; if (!m) return;
const int NUM_OF_DIRS = 3; const int NUM_OF_DIRS = 4;
const char* dirs[] = { const char* dirs[] = {
"00030004", "00030004",
"00030005", "00030005",
"00030015" "00030015",
"00030017"
}; };
const char* blacklist[3][6] = { const char* blacklist[4][6] = {
{ // 00030004 { // 00030004
NULL //nothing blacklisted NULL //nothing blacklisted
}, },
@ -110,6 +111,11 @@ static void generateList(Menu* m)
{ // 00030015 { // 00030015
"484e42", // System Settings "484e42", // System Settings
"484e46", // Nintendo DSi Shop "484e46", // Nintendo DSi Shop
"34544e", // TwlNmenu (blocking due to -2011 and brick potential)
NULL
},
{
"484e41", // Launcher
NULL NULL
} }
}; };
@ -152,10 +158,6 @@ static void generateList(Menu* m)
sprintf(titleId, "%s%02x", blacklist[i][j], region); sprintf(titleId, "%s%02x", blacklist[i][j], region);
if (strcmp(titleId, ent->d_name) == 0) if (strcmp(titleId, ent->d_name) == 0)
blacklisted = true; blacklisted = true;
sprintf(titleId, "%s41", blacklist[i][j]); // also blacklist region 'a'
if (strcmp(titleId, ent->d_name) == 0)
blacklisted = true;
} }
if (blacklisted) continue; if (blacklisted) continue;
} }