diff --git a/src/elf2nro.c b/src/elf2nro.c index bc7fd5b..271b6ed 100644 --- a/src/elf2nro.c +++ b/src/elf2nro.c @@ -258,8 +258,9 @@ int main(int argc, char* argv[]) { } else if (romfs_dir_path) { asset_hdr.romfs.offset = tmp_off; - asset_hdr.romfs.size = build_romfs_by_path_into_file(romfs_dir_path, out, tmp_off); + asset_hdr.romfs.size = build_romfs_by_path_into_file(romfs_dir_path, out, file_off + tmp_off); tmp_off+= asset_hdr.romfs.size; + fseek(out, file_off, SEEK_SET); } fwrite(&asset_hdr, sizeof(asset_hdr), 1, out); diff --git a/src/filepath.h b/src/filepath.h index 4853ebc..6290bc6 100644 --- a/src/filepath.h +++ b/src/filepath.h @@ -4,6 +4,7 @@ #include #ifdef _WIN32 #include +#include #endif #define __USE_LARGEFILE64 @@ -43,7 +44,7 @@ typedef struct _stati64 os_stat64_t; #define os_opendir _wopendir #define os_readdir _wreaddir #define os_stat _wstati64 -#define os_fclose _wfclose +#define os_fclose fclose #define OS_MODE_READ L"rb" #define OS_MODE_WRITE L"wb"