// Copyright 2009 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include #include #include #include "Common/CommonTypes.h" #include "Core/IOS/ES/Formats.h" namespace DiscIO { class BlobReader; class WiiWAD { public: explicit WiiWAD(const std::string& name); explicit WiiWAD(std::unique_ptr blob_reader); WiiWAD(WiiWAD&&) = default; WiiWAD& operator=(WiiWAD&&) = default; ~WiiWAD(); bool IsValid() const { return m_valid; } const std::vector& GetCertificateChain() const { return m_certificate_chain; } const IOS::ES::TicketReader& GetTicket() const { return m_ticket; } const IOS::ES::TMDReader& GetTMD() const { return m_tmd; } const std::vector& GetDataApp() const { return m_data_app; } const std::vector& GetFooter() const { return m_footer; } std::vector GetContent(u16 index) const; private: bool ParseWAD(); bool m_valid = false; std::unique_ptr m_reader; u64 m_data_app_offset = 0; std::vector m_certificate_chain; IOS::ES::TicketReader m_ticket; IOS::ES::TMDReader m_tmd; std::vector m_data_app; std::vector m_footer; }; } // namespace DiscIO