From 23b4b50991a11f929764d8adc129fe64379e244b Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 26 Oct 2020 23:48:39 +0100 Subject: [PATCH] Verify TMD when installing / building CIA --- arm9/source/utils/gameutil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arm9/source/utils/gameutil.c b/arm9/source/utils/gameutil.c index eebd857..e449d3b 100644 --- a/arm9/source/utils/gameutil.c +++ b/arm9/source/utils/gameutil.c @@ -1838,8 +1838,8 @@ u32 InstallFromCiaFile(const char* path_cia, const char* path_dest) { if (getbe32(cia->ticket.console_id) != (&ARM9_ITCM->otp)->deviceId) memset(cia->ticket.console_id, 0x00, 4); - // fix TMD hashes, install CIA system data - if ((FixTmdHashes(&(cia->tmd)) != 0) || + // verify TMD hashes, install CIA system data + if ((VerifyTmd(&(cia->tmd)) != 0) || (InstallCiaSystemData(cia, path_dest) != 0)) { free(cia); return 1; @@ -2019,8 +2019,8 @@ u32 BuildInstallFromTmdFileBuffered(const char* path_tmd, const char* path_dest, } } - // write the CIA stub (take #2) - if ((FixTmdHashes(tmd) != 0) || + // verify TMD / write CIA stub / install system data (take #2) + if ((VerifyTmd(tmd) != 0) || (!install && (WriteCiaStub(cia, path_dest) != 0)) || (install && (InstallCiaSystemData(cia, path_dest) != 0))) return 1;