mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-07 16:59:41 +00:00
Add missing return.
This commit is contained in:
+42
-10
@@ -75,6 +75,8 @@ int SignCXI(ncch_hdr *hdr, keys_struct *keys)
|
|||||||
memset(GetNcchHdrSig(hdr), 0xFF, 0x100);
|
memset(GetNcchHdrSig(hdr), 0xFF, 0x100);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CheckCXISignature(ncch_hdr *hdr, u8 *pubk)
|
int CheckCXISignature(ncch_hdr *hdr, u8 *pubk)
|
||||||
@@ -97,49 +99,79 @@ int build_NCCH(user_settings *usrset)
|
|||||||
|
|
||||||
// Get Settings
|
// Get Settings
|
||||||
result = GetNcchSettings(ncchset,usrset);
|
result = GetNcchSettings(ncchset,usrset);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to initialize context.\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
// Import Data
|
// Import Data
|
||||||
result = ImportNonCodeExeFsSections(ncchset);
|
result = ImportNonCodeExeFsSections(ncchset);
|
||||||
if(result) return result;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to import non-code ExeFs sections\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
result = ImportLogo(ncchset);
|
result = ImportLogo(ncchset);
|
||||||
if(result) return result;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to import Logo\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
if(!ncchset->options.IsCfa){ // CXI Specific Sections
|
if(!ncchset->options.IsCfa){ // CXI Specific Sections
|
||||||
// Build ExeFs Code Section\n");
|
// Build ExeFs Code Section\n");
|
||||||
result = BuildExeFsCode(ncchset);
|
result = BuildExeFsCode(ncchset);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to build ExeFs code\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
// Build ExHeader\n");
|
// Build ExHeader\n");
|
||||||
result = BuildExHeader(ncchset);
|
result = BuildExHeader(ncchset);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to build ExHeader\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build ExeFs\n");
|
// Build ExeFs\n");
|
||||||
result = BuildExeFs(ncchset);
|
result = BuildExeFs(ncchset);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to build ExeFs\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Prepare for RomFs\n");
|
// Prepare for RomFs\n");
|
||||||
romfs_buildctx romfs;
|
romfs_buildctx romfs;
|
||||||
memset(&romfs,0,sizeof(romfs_buildctx));
|
memset(&romfs,0,sizeof(romfs_buildctx));
|
||||||
result = SetupRomFs(ncchset,&romfs);
|
result = SetupRomFs(ncchset,&romfs);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to setup RomFs\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Setup NCCH including final memory allocation\n");
|
// Setup NCCH including final memory allocation\n");
|
||||||
result = SetupNcch(ncchset,&romfs);
|
result = SetupNcch(ncchset,&romfs);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to setup NCCH\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
// Build RomFs\n");
|
// Build RomFs\n");
|
||||||
result = BuildRomFs(&romfs);
|
result = BuildRomFs(&romfs);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to build RomFs\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
// Finalise NCCH (Hashes/Signatures and crypto)\n");
|
// Finalise NCCH (Hashes/Signatures and crypto)\n");
|
||||||
result = FinaliseNcch(ncchset);
|
result = FinaliseNcch(ncchset);
|
||||||
if(result) goto finish;
|
if(result) {
|
||||||
|
fprintf(stderr,"[NCCH ERROR] Failed to finalize NCCH\n");
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if(result)
|
if(result)
|
||||||
|
|||||||
Reference in New Issue
Block a user