From c7f10be1b47931137fa17dab962ad82936153332 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Fri, 14 Aug 2020 14:05:56 +0200 Subject: [PATCH] CIA installer: only fix console ID when different --- arm9/source/utils/gameutil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arm9/source/utils/gameutil.c b/arm9/source/utils/gameutil.c index 4f49675..6f40012 100644 --- a/arm9/source/utils/gameutil.c +++ b/arm9/source/utils/gameutil.c @@ -3,6 +3,7 @@ #include "disadiff.h" #include "game.h" #include "nand.h" // so that we can trim NAND images +#include "itcm.h" // we need access to part of the OTP #include "hid.h" #include "ui.h" #include "fs.h" @@ -1771,8 +1772,9 @@ u32 InstallFromCiaFile(const char* path_cia, const char* path_dest) { next_offset += size; } - // proactive fix for CIA console ID - memset(cia->ticket.console_id, 0x00, 4); + // fix for CIA console ID (if device ID different) + 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) ||