DiscIO: Add parameters to BlobReader::SupportsReadWiiDecrypted

It's possible (but rare) for a WIA or RVZ file to support
this for some partitions but not all, and for the game and
the blob code to disagree on how large a partition is.
This commit is contained in:
JosJuice
2020-08-29 15:12:02 +02:00
parent 800b2480ec
commit 047bb80337
7 changed files with 72 additions and 34 deletions

View File

@ -157,7 +157,7 @@ public:
DirectoryBlobReader& operator=(DirectoryBlobReader&&) = default;
bool Read(u64 offset, u64 length, u8* buffer) override;
bool SupportsReadWiiDecrypted() const override;
bool SupportsReadWiiDecrypted(u64 offset, u64 size, u64 partition_data_offset) const override;
bool ReadWiiDecrypted(u64 offset, u64 size, u8* buffer, u64 partition_data_offset) override;
BlobType GetBlobType() const override;
@ -185,6 +185,8 @@ private:
explicit DirectoryBlobReader(const std::string& game_partition_root,
const std::string& true_root);
const DirectoryBlobPartition* GetPartition(u64 offset, u64 size, u64 partition_data_offset) const;
bool EncryptPartitionData(u64 offset, u64 size, u8* buffer, u64 partition_data_offset,
u64 partition_data_decrypted_size);