From ca333bd71d514c6dd75d44ddeb2681e2b6005d10 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sat, 1 Aug 2020 00:52:40 -0400 Subject: [PATCH] Missing fs commit changes. --- code_templates/dump_title_infos.c | 2 ++ code_templates/gc_key_area.c | 1 + code_templates/system_title_dumper.c | 6 ++++++ source/main.c | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/code_templates/dump_title_infos.c b/code_templates/dump_title_infos.c index 3943815..78b0f37 100644 --- a/code_templates/dump_title_infos.c +++ b/code_templates/dump_title_infos.c @@ -58,6 +58,7 @@ fwrite(app_metadata->icon, 1, app_metadata->icon_size, icon_jpg); fclose(icon_jpg); icon_jpg = NULL; + utilsCommitSdCardFileSystemChanges(); } } } @@ -75,5 +76,6 @@ fclose(title_infos_txt); title_infos_txt = NULL; + utilsCommitSdCardFileSystemChanges(); } } \ No newline at end of file diff --git a/code_templates/gc_key_area.c b/code_templates/gc_key_area.c index 55a0ed0..aee8098 100644 --- a/code_templates/gc_key_area.c +++ b/code_templates/gc_key_area.c @@ -90,6 +90,7 @@ int main(int argc, char *argv[]) fwrite(&gc_key_area, 1, sizeof(GameCardKeyArea), kafd); fclose(kafd); + utilsCommitSdCardFileSystemChanges(); consolePrint("successfully saved key area to \"%s\"\n", path); diff --git a/code_templates/system_title_dumper.c b/code_templates/system_title_dumper.c index 6cc3bd8..15290f3 100644 --- a/code_templates/system_title_dumper.c +++ b/code_templates/system_title_dumper.c @@ -50,6 +50,7 @@ static void dumpPartitionFs(TitleInfo *info, NcaFsSectionContext *nca_fs_ctx) char *pfs_entry_name = NULL; size_t path_len = 0; + *path = '\0'; if (!pfsInitializeContext(&pfs_ctx, nca_fs_ctx)) { @@ -117,6 +118,8 @@ end: remove(path); } + if (*path) utilsCommitFileSystemChangesByPath(path); + pfsFreeContext(&pfs_ctx); } @@ -129,6 +132,7 @@ static void dumpRomFs(TitleInfo *info, NcaFsSectionContext *nca_fs_ctx) RomFileSystemFileEntry *romfs_file_entry = NULL; size_t path_len = 0; + *path = '\0'; if (!romfsInitializeContext(&romfs_ctx, nca_fs_ctx)) { @@ -190,6 +194,8 @@ end: remove(path); } + if (*path) utilsCommitFileSystemChangesByPath(path); + romfsFreeContext(&romfs_ctx); } diff --git a/source/main.c b/source/main.c index 6cc3bd8..15290f3 100644 --- a/source/main.c +++ b/source/main.c @@ -50,6 +50,7 @@ static void dumpPartitionFs(TitleInfo *info, NcaFsSectionContext *nca_fs_ctx) char *pfs_entry_name = NULL; size_t path_len = 0; + *path = '\0'; if (!pfsInitializeContext(&pfs_ctx, nca_fs_ctx)) { @@ -117,6 +118,8 @@ end: remove(path); } + if (*path) utilsCommitFileSystemChangesByPath(path); + pfsFreeContext(&pfs_ctx); } @@ -129,6 +132,7 @@ static void dumpRomFs(TitleInfo *info, NcaFsSectionContext *nca_fs_ctx) RomFileSystemFileEntry *romfs_file_entry = NULL; size_t path_len = 0; + *path = '\0'; if (!romfsInitializeContext(&romfs_ctx, nca_fs_ctx)) { @@ -190,6 +194,8 @@ end: remove(path); } + if (*path) utilsCommitFileSystemChangesByPath(path); + romfsFreeContext(&romfs_ctx); }