From da412226be6a454403eed2462031f4ab7e9209ae Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 4 Nov 2019 23:44:11 +0100 Subject: [PATCH] Fix #562 --- arm9/source/game/firm.c | 15 +++++++++------ arm9/source/utils/gameutil.c | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arm9/source/game/firm.c b/arm9/source/game/firm.c index 3b002e3..dfc252e 100644 --- a/arm9/source/game/firm.c +++ b/arm9/source/game/firm.c @@ -173,14 +173,17 @@ u32 SetupSecretKey(u32 keynum) { if (keynum >= 0x200/0x10) return 1; // safety - // try to load full secret sector or key from file - if (!(got_keys & (0x1< got them all - } else if ((keynum < 2) && (LoadKeyFromFile(key, 0x11, 'N', (keynum == 0) ? "95" : "96"))) { - got_keys |= (0x1< FIRM_MAX_SIZE) || (fvx_qread(orig, firm_buffer, 0, firm_size, NULL) != FR_OK) || (DecryptFirmFull(firm_buffer, firm_size) != 0)) { @@ -1050,11 +1051,13 @@ u32 DecryptFirmFile(const char* orig, const char* dest) { memcpy(firm->dec_magic, dec_magic, sizeof(dec_magic)); // write decrypted FIRM to the destination file + ShowProgress(1, 2, dest); if (fvx_qwrite(dest, firm_buffer, 0, firm_size, NULL) != FR_OK) { free(firm_buffer); return 1; } + ShowProgress(2, 2, dest); free(firm_buffer); return 0; }