mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
makerom v0.5
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user