From 23fc5f9e35790b8863714e31595fac5051c3cfb5 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 26 Nov 2019 18:57:44 +0100 Subject: [PATCH] VolumeWii: Check SupportsReadWiiDecrypted before m_encrypted Fixes using DirectoryBlob on extracted games that were unencrypted prior to being extracted. (One day I'll make DirectoryBlob actually support raw reads and then the order of these two won't matter...) --- Source/Core/DiscIO/VolumeWii.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index bc39a7aae45b..d2a1fba3db3a 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -162,6 +162,9 @@ bool VolumeWii::Read(u64 offset, u64 length, u8* buffer, const Partition& partit if (partition == PARTITION_NONE) return m_reader->Read(offset, length, buffer); + if (m_reader->SupportsReadWiiDecrypted()) + return m_reader->ReadWiiDecrypted(offset, length, buffer, partition.offset); + auto it = m_partitions.find(partition); if (it == m_partitions.end()) return false; @@ -173,9 +176,6 @@ bool VolumeWii::Read(u64 offset, u64 length, u8* buffer, const Partition& partit buffer); } - if (m_reader->SupportsReadWiiDecrypted()) - return m_reader->ReadWiiDecrypted(offset, length, buffer, partition.offset); - mbedtls_aes_context* aes_context = partition_details.key->get(); if (!aes_context) return false;