makerom v0.8

This commit is contained in:
3DSGuy
2014-05-06 07:23:00 +08:00
parent c2a18c961d
commit 1060604377
36 changed files with 2019 additions and 1177 deletions
+11
View File
@@ -1,4 +1,5 @@
#include "lib.h"
#include "dir.h"
#include "ncch.h"
#include "romfs.h"
@@ -8,6 +9,16 @@ int PrepareImportRomFsBinaryFromFile(ncch_settings *ncchset, romfs_buildctx *ctx
ctx->romfsSize = ncchset->componentFilePtrs.romfsSize;
ctx->romfsBinary = ncchset->componentFilePtrs.romfs;
ivfc_hdr *hdr = calloc(1,sizeof(ivfc_hdr));
ReadFile_64(hdr,sizeof(ivfc_hdr),0,ctx->romfsBinary);
if(memcmp(hdr->magic,"IVFC",4) != 0){
fprintf(stderr,"[ROMFS ERROR] Invalid RomFS Binary.\n");
return INVALID_ROMFS_FILE;
}
ctx->romfsHeaderSize = align(sizeof(ivfc_hdr),0x10) + (u64)u8_to_u32(hdr->masterHashSize,LE);
return 0;
}