VolumeVerifier: Check hashes in Wii partitions

This commit is contained in:
JosJuice
2019-03-26 17:22:18 +01:00
parent 84cbd5150f
commit 4fd2d8e8c4
7 changed files with 184 additions and 116 deletions

View File

@ -56,8 +56,9 @@ public:
std::optional<u8> GetDiscNumber(const Partition& partition = PARTITION_NONE) const override;
Platform GetVolumeType() const override;
bool SupportsIntegrityCheck() const override { return true; }
bool CheckIntegrity(const Partition& partition) const override;
bool SupportsIntegrityCheck() const override { return m_encrypted; }
bool CheckH3TableIntegrity(const Partition& partition) const override;
bool CheckBlockIntegrity(u64 block_index, const Partition& partition) const override;
Region GetRegion() const override;
Country GetCountry(const Partition& partition = PARTITION_NONE) const override;
@ -66,6 +67,8 @@ public:
bool IsSizeAccurate() const override;
u64 GetRawSize() const override;
static constexpr unsigned int H3_TABLE_SIZE = 0x18000;
static constexpr unsigned int BLOCK_HEADER_SIZE = 0x0400;
static constexpr unsigned int BLOCK_DATA_SIZE = 0x7C00;
static constexpr unsigned int BLOCK_TOTAL_SIZE = BLOCK_HEADER_SIZE + BLOCK_DATA_SIZE;
@ -80,6 +83,7 @@ private:
Common::Lazy<IOS::ES::TicketReader> ticket;
Common::Lazy<IOS::ES::TMDReader> tmd;
Common::Lazy<std::vector<u8>> cert_chain;
Common::Lazy<std::vector<u8>> h3_table;
Common::Lazy<std::unique_ptr<FileSystem>> file_system;
Common::Lazy<u64> data_offset;
u32 type;