From e0a47c11f5653ecffb79adfac29c19a163baab8f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 10 Aug 2015 16:35:23 +0200 Subject: Fix reading Wii FST size (for real this time) 04fcb72 fixed an issue with reading the Wii FST size, but I found a second issue when working on PR #2820 - the size must be shifted left by 2. DiscScrubber and Boot already do this correctly using separate code. --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 5701dab1cc..aabbeed2c6 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -206,7 +206,7 @@ std::map CVolumeWiiCrypted::GetNames(bool prefe return ReadWiiNames(opening_bnr); } -u32 CVolumeWiiCrypted::GetFSTSize() const +u64 CVolumeWiiCrypted::GetFSTSize() const { if (m_pReader == nullptr) return 0; @@ -216,7 +216,7 @@ u32 CVolumeWiiCrypted::GetFSTSize() const if (!Read(0x428, 0x4, (u8*)&size, true)) return 0; - return Common::swap32(size); + return (u64)Common::swap32(size) << 2; } std::string CVolumeWiiCrypted::GetApploaderDate() const -- cgit v1.2.3 From 1db1a8aacf7c5d0d8a7e36f2c6f2e452b0971ed0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 31 Aug 2015 19:27:18 -0400 Subject: VolumeCreator: Use a unique_ptr in CreateVolumeFromFilename --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 5701dab1cc..adfe408e3e 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -5,7 +5,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -25,9 +27,9 @@ namespace DiscIO { -CVolumeWiiCrypted::CVolumeWiiCrypted(IBlobReader* _pReader, u64 _VolumeOffset, +CVolumeWiiCrypted::CVolumeWiiCrypted(std::unique_ptr reader, u64 _VolumeOffset, const unsigned char* _pVolumeKey) - : m_pReader(_pReader), + : m_pReader(std::move(reader)), m_AES_ctx(new aes_context), m_pBuffer(nullptr), m_VolumeOffset(_VolumeOffset), -- cgit v1.2.3 From 222b33f0a39d9be4f7b4fe96e4b9babbdebeb38f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 31 Aug 2015 19:30:32 -0400 Subject: VolumeCreator: Fix a typo in VolumeKeyForPartition's name --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index adfe408e3e..a6ec5a6e33 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -46,7 +46,7 @@ bool CVolumeWiiCrypted::ChangePartition(u64 offset) m_LastDecryptedBlockOffset = -1; u8 volume_key[16]; - DiscIO::VolumeKeyForParition(*m_pReader, offset, volume_key); + DiscIO::VolumeKeyForPartition(*m_pReader, offset, volume_key); aes_setkey_dec(m_AES_ctx.get(), volume_key, 128); return true; } -- cgit v1.2.3 From 4b9b82e00016cbb8aa3c8a45bd32aea460f28c07 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Sep 2015 13:25:54 -0400 Subject: DiscIO: Do swapping in GetTitleID implementations Gets rid of external swaps at every usage. --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 96fe209d0d..aa7f36da64 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -107,11 +107,15 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer, bool de return true; } -bool CVolumeWiiCrypted::GetTitleID(u8* _pBuffer) const +bool CVolumeWiiCrypted::GetTitleID(u64* buffer) const { // Tik is at m_VolumeOffset size 0x2A4 // TitleID offset in tik is 0x1DC - return Read(m_VolumeOffset + 0x1DC, 8, _pBuffer, false); + if (!Read(m_VolumeOffset + 0x1DC, sizeof(u64), reinterpret_cast(buffer), false)) + return false; + + *buffer = Common::swap64(*buffer); + return true; } std::unique_ptr CVolumeWiiCrypted::GetTMD(u32 *size) const -- cgit v1.2.3 From 6935d281128ea78169ecde44e869f83a7b67ddb8 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 26 Sep 2015 15:24:29 +0200 Subject: Display all compressed formats in blue in GUI In the past, only GCZ was shown as compressed, not CISO and WBFS. --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index aa7f36da64..87c68f8cd2 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -250,6 +250,11 @@ u8 CVolumeWiiCrypted::GetDiscNumber() const return disc_number; } +bool CVolumeWiiCrypted::IsCompressed() const +{ + return m_pReader ? m_pReader->IsCompressed() : false; +} + u64 CVolumeWiiCrypted::GetSize() const { if (m_pReader) -- cgit v1.2.3