From 0a0f623c7c9ee44cccde032f8c99f1a6650264cf Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:46:38 +0000 Subject: [PATCH] NCCH: Fix saveDataSize (Oops) --- include/loader/ncch.hpp | 3 ++- src/core/loader/ncch.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/loader/ncch.hpp b/include/loader/ncch.hpp index 4aa2ede7..92ad5040 100644 --- a/include/loader/ncch.hpp +++ b/include/loader/ncch.hpp @@ -50,6 +50,7 @@ struct NCCH { static constexpr u64 mediaUnit = 0x200; u64 size = 0; // Size of NCCH converted to bytes + u64 saveDataSize = 0; u32 stackSize = 0; u32 bssSize = 0; u32 exheaderSize = 0; @@ -76,7 +77,7 @@ struct NCCH { bool hasExeFS() { return exeFS.size != 0; } bool hasRomFS() { return romFS.size != 0; } bool hasCode() { return codeFile.size() != 0; } - bool hasSaveData() { return saveData.size() != 0; } + bool hasSaveData() { return saveDataSize != 0; } // Parse SMDH for region info and such. Returns false on failure, true on success bool parseSMDH(const std::vector &smdh); diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 4be05549..e363213c 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -155,7 +155,7 @@ bool NCCH::loadFromHeader(Crypto::AESEngine &aesEngine, IOFile& file, const FSIn } } - [[maybe_unused]] const u64 saveDataSize = *(u64*)&exheader[0x1C0 + 0x0]; // Size of save data in bytes + saveDataSize = *(u64*)&exheader[0x1C0 + 0x0]; // Size of save data in bytes compressCode = (exheader[0xD] & 1) != 0; stackSize = *(u32*)&exheader[0x1C];