Improve Unlaunch check

This commit is contained in:
Pk11 2022-01-14 19:21:34 -06:00
parent 6d8fb9ca44
commit a831de4333

View File

@ -136,17 +136,26 @@ int main(int argc, char **argv)
return 0; return 0;
} }
for (char region = 'A'; region <= 'Z'; region++) //check for unlaunch
{ {
char path[64]; bool unlaunchFound = false;
sprintf(path, "nand:/title/00030017/484e41%02x/content/title.tmd", region); FILE *file = fopen("nand:/sys/HWINFO_S.dat", "rb");
unsigned long long tmdSize = getFileSizePath(path); if (file)
if (tmdSize != 0)
{ {
if (tmdSize <= 520) fseek(file, 0xA0, SEEK_SET);
messageBox("Unlaunch not found, please\ninstall it.\n\n\x1B[46mhttps://dsi.cfw.guide/\x1B[47m"); u32 launcherTid;
break; fread(&launcherTid, sizeof(u32), 1, file);
fclose(file);
char path[64];
sprintf(path, "nand:/title/00030017/%08lx/content/title.tmd", launcherTid);
unsigned long long tmdSize = getFileSizePath(path);
if (tmdSize > 520)
unlaunchFound = true;
} }
if (!unlaunchFound)
messageBox("Unlaunch not found, please\ninstall it.\n\n\x1B[46mhttps://dsi.cfw.guide/\x1B[47m");
} }
messageBox("\x1B[41mWARNING:\x1B[47m This tool can write to\nyour internal NAND!\n\nThis always has a risk, albeit\nlow, of \x1B[41mbricking\x1B[47m your system\nand should be done with caution!"); messageBox("\x1B[41mWARNING:\x1B[47m This tool can write to\nyour internal NAND!\n\nThis always has a risk, albeit\nlow, of \x1B[41mbricking\x1B[47m your system\nand should be done with caution!");