From 7e7da8c42a6cd9789c859676ebece6f16fb61bde Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 17 Apr 2018 17:28:57 +0100 Subject: [PATCH 1/2] fix romfsdir output --- src/elf2nro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); From 67fff8b2fc920c5471f1828e179a82ce6660cc98 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 17 Apr 2018 17:29:23 +0100 Subject: [PATCH 2/2] fix windows build --- src/filepath.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"