makerom v0.2

This commit is contained in:
3DSGuy
2014-02-21 03:14:00 +08:00
parent 0155b2098e
commit 3c9fffd56a
24 changed files with 1825 additions and 1097 deletions
+8
View File
@@ -9,6 +9,10 @@ int ImportRomFsBinaryFromFile(ncch_settings *ncchset);
int BuildRomFs(ncch_settings *ncchset)
{
int result = 0;
// If Not Using RomFS Return
if(!ncchset->Options.UseRomFS) return result;
if(ncchset->ComponentFilePtrs.romfs){ // The user has specified a pre-built RomFs Binary
result = ImportRomFsBinaryFromFile(ncchset);
return result;
@@ -25,6 +29,10 @@ int ImportRomFsBinaryFromFile(ncch_settings *ncchset)
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;
}
return 0;
}