From 8cd695c229917d5be83d19a4aa98c0ba84a820d3 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 27 Sep 2015 10:10:40 -0700 Subject: [PATCH] Fix parseDol --- include/NOD/DiscBase.hpp | 1 - lib/DiscBase.cpp | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/NOD/DiscBase.hpp b/include/NOD/DiscBase.hpp index cb764d8..c541b83 100644 --- a/include/NOD/DiscBase.hpp +++ b/include/NOD/DiscBase.hpp @@ -173,7 +173,6 @@ public: std::vector m_nodes; void parseFST(IPartReadStream& s); - DOLHeader m_dolHead; uint64_t m_dolSz; void parseDOL(IPartReadStream& s); diff --git a/lib/DiscBase.cpp b/lib/DiscBase.cpp index e82ad62..a2ce21d 100644 --- a/lib/DiscBase.cpp +++ b/lib/DiscBase.cpp @@ -47,14 +47,16 @@ void DiscBase::IPartition::parseFST(IPartReadStream& s) void DiscBase::IPartition::parseDOL(IPartReadStream& s) { /* Read Dol header */ - s.read(&m_dolHead, sizeof(DOLHeader)); + DOLHeader dolHeader; + s.read(&dolHeader, sizeof(DOLHeader)); /* Calculate Dol size */ - uint32_t dolSize = SBig(m_dolHead.textOff[0]) - sizeof(DOLHeader); + uint32_t dolSize = SBig(dolHeader.textOff[0]); for (uint32_t i = 0 ; i < 7 ; i++) - dolSize += SBig(m_dolHead.textSizes[i]); + dolSize += SBig(dolHeader.textSizes[i]); for (uint32_t i = 0 ; i < 11 ; i++) - dolSize += SBig(m_dolHead.dataSizes[i]); + dolSize += SBig(dolHeader.dataSizes[i]); + m_dolSz = dolSize; }