makerom v0.5

This commit is contained in:
3DSGuy
2014-04-01 14:08:00 +08:00
parent 510988b07a
commit 26772b49c8
45 changed files with 5630 additions and 4132 deletions
+7 -7
View File
@@ -11,9 +11,9 @@ int BuildRomFs(ncch_settings *ncchset)
int result = 0;
// If Not Using RomFS Return
if(!ncchset->Options.UseRomFS) return result;
if(!ncchset->options.UseRomFS) return result;
if(ncchset->ComponentFilePtrs.romfs){ // The user has specified a pre-built RomFs Binary
if(ncchset->componentFilePtrs.romfs){ // The user has specified a pre-built RomFs Binary
result = ImportRomFsBinaryFromFile(ncchset);
return result;
}
@@ -25,11 +25,11 @@ int BuildRomFs(ncch_settings *ncchset)
int ImportRomFsBinaryFromFile(ncch_settings *ncchset)
{
ncchset->Sections.RomFs.size = ncchset->ComponentFilePtrs.romfs_size;
ncchset->Sections.RomFs.buffer = malloc(ncchset->Sections.RomFs.size);
if(!ncchset->Sections.RomFs.buffer) {fprintf(stderr,"[ROMFS ERROR] MEM ERROR\n"); return MEM_ERROR;}
ReadFile_64(ncchset->Sections.RomFs.buffer,ncchset->Sections.RomFs.size,0,ncchset->ComponentFilePtrs.romfs);
if(memcmp(ncchset->Sections.RomFs.buffer,"IVFC",4) != 0){
ncchset->sections.romFs.size = ncchset->componentFilePtrs.romfsSize;
ncchset->sections.romFs.buffer = malloc(ncchset->sections.romFs.size);
if(!ncchset->sections.romFs.buffer) {fprintf(stderr,"[ROMFS ERROR] MEM ERROR\n"); return MEM_ERROR;}
ReadFile_64(ncchset->sections.romFs.buffer,ncchset->sections.romFs.size,0,ncchset->componentFilePtrs.romfs);
if(memcmp(ncchset->sections.romFs.buffer,"IVFC",4) != 0){
fprintf(stderr,"[ROMFS ERROR] Invalid RomFS Binary.\n");
return INVALID_ROMFS_FILE;
}