Merge pull request #10970 from AdmiralCurtiss/directoryblob-encrypted
DirectoryBlob: Fix partition size mixup for encrypted Wii discs.
This commit is contained in:
commit
92c6407c45
|
@ -663,10 +663,14 @@ void DirectoryBlobReader::SetPartitions(std::vector<PartitionWithType>&& partiti
|
|||
|
||||
SetPartitionHeader(&partitions[i].partition, partition_address);
|
||||
|
||||
const u64 data_size = partitions[i].partition.GetDataSize();
|
||||
const u64 data_size =
|
||||
Common::AlignUp(partitions[i].partition.GetDataSize(), VolumeWii::BLOCK_DATA_SIZE);
|
||||
partitions[i].partition.SetDataSize(data_size);
|
||||
const u64 encrypted_data_size =
|
||||
(data_size / VolumeWii::BLOCK_DATA_SIZE) * VolumeWii::BLOCK_TOTAL_SIZE;
|
||||
const u64 partition_data_offset = partition_address + PARTITION_DATA_OFFSET;
|
||||
m_partitions.emplace(partition_data_offset, std::move(partitions[i].partition));
|
||||
m_nonpartition_contents.Add(partition_data_offset, data_size,
|
||||
m_nonpartition_contents.Add(partition_data_offset, encrypted_data_size,
|
||||
ContentPartition{this, 0, partition_data_offset});
|
||||
const u64 unaligned_next_partition_address = VolumeWii::OffsetInHashedPartitionToRawOffset(
|
||||
data_size, Partition(partition_address), PARTITION_DATA_OFFSET);
|
||||
|
|
|
@ -204,6 +204,7 @@ public:
|
|||
|
||||
bool IsWii() const { return m_is_wii; }
|
||||
u64 GetDataSize() const { return m_data_size; }
|
||||
void SetDataSize(u64 size) { m_data_size = size; }
|
||||
const std::string& GetRootDirectory() const { return m_root_directory; }
|
||||
const std::vector<u8>& GetHeader() const { return m_disc_header; }
|
||||
const DiscContentContainer& GetContents() const { return m_contents; }
|
||||
|
|
Loading…
Reference in New Issue