Merge pull request #5548 from JosJuice/volume-wii-unencrypted

Reimplement support for unencrypted Wii discs
This commit is contained in:
shuffle2 2017-06-06 01:37:52 -07:00 committed by GitHub
commit 1113b131f2
2 changed files with 7 additions and 7 deletions

View File

@ -96,14 +96,8 @@ std::unique_ptr<IVolume> CreateVolumeFromFilename(const std::string& filename)
// Check for Wii
const std::optional<u32> wii_magic = reader->ReadSwapped<u32>(0x18);
if (wii_magic == u32(0x5D1C9EA3))
{
const std::optional<u32> wii_container_magic = reader->ReadSwapped<u32>(0x60);
if (wii_container_magic == u32(0))
return std::make_unique<CVolumeWiiCrypted>(std::move(reader));
return std::make_unique<CVolumeGC>(std::move(reader));
}
// Check for WAD
// 0x206962 for boot2 wads
const std::optional<u32> wad_magic = reader->ReadSwapped<u32>(0x02);

View File

@ -36,6 +36,12 @@ CVolumeWiiCrypted::CVolumeWiiCrypted(std::unique_ptr<IBlobReader> reader)
{
_assert_(m_pReader);
if (m_pReader->ReadSwapped<u32>(0x60) != u32(0))
{
// No partitions - just read unencrypted data like with a GC disc
return;
}
// Get tickets, TMDs, and decryption keys for all partitions
for (u32 partition_group = 0; partition_group < 4; ++partition_group)
{