Don't verify ExeFS for Process9

This commit is contained in:
d0k3 2018-02-07 02:16:31 +01:00
parent d714d580e8
commit 79a3bfc9e1
2 changed files with 33 additions and 3 deletions

View File

@ -302,6 +302,7 @@ u32 VerifyTmdContent(const char* path, u64 offset, TmdContentChunk* chunk, const
u32 VerifyNcchFile(const char* path, u32 offset, u32 size) {
NcchHeader ncch;
NcchExtHeader exthdr;
ExeFsHeader exefs;
FIL file;
@ -313,7 +314,7 @@ u32 VerifyNcchFile(const char* path, u32 offset, u32 size) {
return 1;
fvx_lseek(&file, offset);
if (GetNcchHeaders(&ncch, NULL, NULL, &file) != 0) {
if (GetNcchHeaders(&ncch, &exthdr, NULL, &file) != 0) {
if (!offset) ShowPrompt(false, "%s\nError: Not a NCCH file", pathstr);
fvx_close(&file);
return 1;
@ -363,8 +364,8 @@ u32 VerifyNcchFile(const char* path, u32 offset, u32 size) {
ver_romfs = CheckNcchHash(ncch.hash_romfs, &file, ncch.size_romfs_hash * NCCH_MEDIA_UNIT, offset, &ncch, NULL);
}
// thorough exefs verification
if (ncch.size_exefs > 0) {
// thorough exefs verification (workaround for Process9)
if ((ncch.size_exefs > 0) && (memcmp(exthdr.name, "Process9", 8) != 0)) {
for (u32 i = 0; !ver_exefs && (i < 10); i++) {
ExeFsFileHeader* exefile = exefs.files + i;
u8* hash = exefs.hashes[9 - i];

29
data/testbug.gm9 Normal file
View File

@ -0,0 +1,29 @@
@MainMenu
labelsel -s -o "Main Menu" MainMenu_*
goto MainMenu
@MainMenu_Option1
labelsel -s -o "Option 1 Sub-Menu" MainMenu_Option1_*
goto MainMenu
@MainMenu_Option1_A
echo "This is Option 1 A"
goto MainMenu_Option1
@MainMenu_Option1_B
echo "This is Option 1 B"
goto MainMenu_Option1
@MainMenu_Option2
echo "This is Option 2"
goto MainMenu
@MainMenu_Option3
echo "This is Option 3"
goto MainMenu
@MainMenu_Reboot
reboot
@MainMenu_Shutdown
poweroff