diff --git a/source/game/gameutil.c b/source/game/gameutil.c index 6675f0d..fa2b30b 100644 --- a/source/game/gameutil.c +++ b/source/game/gameutil.c @@ -1726,6 +1726,10 @@ u32 BuildTitleKeyInfo(const char* path, bool dec, bool dump) { if (dump) { u32 dump_size = TIKDB_SIZE(tik_info); + // ensure the output dir exists + // warning: this will only build output dirs in the root dir (!!!) + if ((f_stat(OUTPUT_PATH, NULL) != FR_OK) && (f_mkdir(OUTPUT_PATH) != FR_OK)) + return 1; f_unlink(path_out); if ((dump_size <= 16) || (fvx_qwrite(path_out, tik_info, 0, dump_size, &br) != FR_OK) || (br != dump_size)) return 1; @@ -1805,6 +1809,10 @@ u32 BuildSeedInfo(const char* path, bool dump) { if (dump) { u32 dump_size = SEEDDB_SIZE(seed_info); + // ensure the output dir exists + // warning: this will only build output dirs in the root dir (!!!) + if ((f_stat(OUTPUT_PATH, NULL) != FR_OK) && (f_mkdir(OUTPUT_PATH) != FR_OK)) + return 1; f_unlink(path_out); if ((dump_size <= 16) || (fvx_qwrite(path_out, seed_info, 0, dump_size, &br) != FR_OK) || (br != dump_size)) return 1; diff --git a/source/game/keydbutil.c b/source/game/keydbutil.c index 448b334..730720e 100644 --- a/source/game/keydbutil.c +++ b/source/game/keydbutil.c @@ -17,6 +17,13 @@ u32 CryptAesKeyDb(const char* path, bool inplace, bool encrypt) { if (!CheckWritePermissions(path_out)) return 1; + if (!inplace) { + // ensure the output dir exists + // warning: this will only build output dirs in the root dir (!!!) + if ((f_stat(OUTPUT_PATH, NULL) != FR_OK) && (f_mkdir(OUTPUT_PATH) != FR_OK)) + return 1; + } + // load key database if ((fvx_qread(path, keydb, 0, MAIN_BUFFER_SIZE, &bt) != FR_OK) || (bt % sizeof(AesKeyInfo)) || (bt >= MAIN_BUFFER_SIZE)) @@ -110,6 +117,10 @@ u32 BuildKeyDb(const char* path, bool dump) { dump_size += sizeof(AesKeyInfo); if (dump_size >= MAX_KEYDB_SIZE) return 1; } + // ensure the output dir exists + // warning: this will only build output dirs in the root dir (!!!) + if ((f_stat(OUTPUT_PATH, NULL) != FR_OK) && (f_mkdir(OUTPUT_PATH) != FR_OK)) + return 1; f_unlink(path_out); if (!dump_size || (fvx_qwrite(path_out, key_info, 0, dump_size, &br) != FR_OK) || (br != dump_size)) return 1; diff --git a/source/godmode.c b/source/godmode.c index a6f1548..0bef917 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -1176,7 +1176,7 @@ u32 HomeMoreMenu(char* current_path, DirStruct* current_dir, DirStruct* clipboar DeinitSDCardFS(); if ((SdFormatMenu() == 0) || sd_state) {; while (!InitSDCardFS() && - ShowPrompt(true, "Initialising SD card failed! Retry?")); + ShowPrompt(true, "Initializing SD card failed! Retry?")); } ClearScreenF(true, true, COLOR_STD_BG); InitEmuNandBase(true);