Merge pull request #3 from rvtr/master

Allow more types of titles to be installed
This commit is contained in:
Pk11 2023-12-23 14:43:27 -06:00 committed by GitHub
commit ff8b0c3b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 16 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,16 +400,39 @@ bool install(char* fpath, bool systemTitle)
goto error; goto error;
} }
//offer to patch system titles to normal DSiWare on SysNAND //patch dev titles to system titles on SysNAND.
if(!sdnandMode && h->tid_high != 0x00030004) //
//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)
{ {
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) h->tid_high = 0x00030015;
fixHeader = true;
}
//offer to patch system titles to normal DSiWare on SysNAND
if(!sdnandMode && h->tid_high != 0x00030004 && h->tid_high != 0x00030017) //do not allow patching home menus to be normal DSiWare! This will trigger "ERROR! - 0x0000000000000008 HWINFO_SECURE" on prototype launchers. May also cause issues on the prod versions.
{
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;
} }
} }
//offer to patch home menus to be system titles on SysNAND
if(!sdnandMode && h->tid_high == 0x00030017)
{
if(choiceBox("This title is a home menu.\nWould you like to patch it to bea system title?\n\nThis is safer and prevents your\nhome menu from being hidden.") == YES)
{
h->tid_high = 0x00030015;
fixHeader = true;
}
}
//no system titles without Unlaunch //no system titles without Unlaunch
if (!unlaunchFound && h->tid_high != 0x00030004) if (!unlaunchFound && h->tid_high != 0x00030004)
{ {
@ -430,12 +455,23 @@ 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 == 0x30535500 || // Twl SystemUpdater
tidLow == 0x34544e00 || // TwlNmenu
tidLow == 0x54574c00 // TWL EVA
)) || (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
tidLow == 0x34544e00 // TwlNmenu
)) || (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, or the following programs that have all-region codes:
(h->tid_low & 0xFF) == 'A' || //and 'A' (all region) h->tid_low == 0x484e4541 || // PictoChat
h->tid_low == 0x484e4441 || // Download Play
h->tid_low == 0x30535541 || // Twl SystemUpdater (iirc one version fits in NAND)
h->tid_low == 0x34544e41 || // TwlNmenu (blocking due to potential to uninstall system titles)
h->tid_low == 0x54574c41 || // TWL EVA
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
}, },
@ -111,6 +112,10 @@ static void generateList(Menu* m)
"484e42", // System Settings "484e42", // System Settings
"484e46", // Nintendo DSi Shop "484e46", // Nintendo DSi Shop
NULL NULL
},
{ // 00030017
"484e41", // Launcher
NULL
} }
}; };
@ -153,8 +158,10 @@ static void generateList(Menu* m)
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' // also blacklist specific all-region titles
if (strcmp(titleId, ent->d_name) == 0) if ((strcmp("484e4441", ent->d_name) == 0) || // Download Play
(strcmp("484e4541", ent->d_name) == 0) || // PictoChat
(strcmp("34544e41", ent->d_name) == 0)) // TwlNmenu
blacklisted = true; blacklisted = true;
} }
if (blacklisted) continue; if (blacklisted) continue;