mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Properly verify CFA NCCHs
Also fixes NCSD verification
This commit is contained in:
parent
cbe473450f
commit
a05cc1ff56
@ -318,12 +318,19 @@ u32 VerifyNcchFile(const char* path, u32 offset, u32 size) {
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
fvx_lseek(&file, offset);
|
fvx_lseek(&file, offset);
|
||||||
if (GetNcchHeaders(&ncch, &exthdr, NULL, &file) != 0) {
|
if (GetNcchHeaders(&ncch, NULL, NULL, &file) != 0) {
|
||||||
if (!offset) ShowPrompt(false, "%s\nError: Not a NCCH file", pathstr);
|
if (!offset) ShowPrompt(false, "%s\nError: Not a NCCH file", pathstr);
|
||||||
fvx_close(&file);
|
fvx_close(&file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvx_lseek(&file, offset);
|
||||||
|
if (ncch.size_exthdr && (GetNcchHeaders(&ncch, &exthdr, NULL, &file) != 0)) {
|
||||||
|
if (!offset) ShowPrompt(false, "%s\nError: Missing ExtHeader", pathstr);
|
||||||
|
fvx_close(&file);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
fvx_lseek(&file, offset);
|
fvx_lseek(&file, offset);
|
||||||
if (ncch.size_exefs && (GetNcchHeaders(&ncch, NULL, &exefs, &file) != 0)) {
|
if (ncch.size_exefs && (GetNcchHeaders(&ncch, NULL, &exefs, &file) != 0)) {
|
||||||
if (!offset) ShowPrompt(false, "%s\nError: Bad ExeFS header", pathstr);
|
if (!offset) ShowPrompt(false, "%s\nError: Bad ExeFS header", pathstr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user