diff options
| author | JosJuice <josjuice@gmail.com> | 2021-03-22 21:17:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-22 21:17:33 +0100 |
| commit | cb9a4da1fa561fc7fc045516a27a5b1b0e159da1 (patch) | |
| tree | df73256ed41cdea51b8dc417d4190931fa0be04d /Source/Core/DiscIO/VolumeWii.cpp | |
| parent | 57c9c9eb31506682e9821f2086ffc9cfd6665357 (diff) | |
| parent | c0eb95481f021089cd7eeaa4b866c9b18e0f8661 (diff) | |
Merge pull request #9572 from JosJuice/volumeverifier-align-group
VolumeVerifier: Align partition reads to groups
Diffstat (limited to 'Source/Core/DiscIO/VolumeWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWii.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index 63e20ec1e6..cf5503458a 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -412,12 +412,9 @@ bool VolumeWii::CheckH3TableIntegrity(const Partition& partition) const return h3_table_sha1 == contents[0].sha1; } -bool VolumeWii::CheckBlockIntegrity(u64 block_index, const std::vector<u8>& encrypted_data, +bool VolumeWii::CheckBlockIntegrity(u64 block_index, const u8* encrypted_data, const Partition& partition) const { - if (encrypted_data.size() != BLOCK_TOTAL_SIZE) - return false; - auto it = m_partitions.find(partition); if (it == m_partitions.end()) return false; @@ -431,10 +428,10 @@ bool VolumeWii::CheckBlockIntegrity(u64 block_index, const std::vector<u8>& encr return false; HashBlock hashes; - DecryptBlockHashes(encrypted_data.data(), &hashes, aes_context); + DecryptBlockHashes(encrypted_data, &hashes, aes_context); u8 cluster_data[BLOCK_DATA_SIZE]; - DecryptBlockData(encrypted_data.data(), cluster_data, aes_context); + DecryptBlockData(encrypted_data, cluster_data, aes_context); for (u32 hash_index = 0; hash_index < 31; ++hash_index) { @@ -474,7 +471,7 @@ bool VolumeWii::CheckBlockIntegrity(u64 block_index, const Partition& partition) std::vector<u8> cluster(BLOCK_TOTAL_SIZE); if (!m_reader->Read(cluster_offset, cluster.size(), cluster.data())) return false; - return CheckBlockIntegrity(block_index, cluster, partition); + return CheckBlockIntegrity(block_index, cluster.data(), partition); } bool VolumeWii::HashGroup(const std::array<u8, BLOCK_DATA_SIZE> in[BLOCKS_PER_GROUP], |
