2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:09:55 -06:00
|
|
|
// Refer to the license.txt file included.
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2017-05-14 04:05:43 -06:00
|
|
|
#include <memory>
|
2009-07-05 20:10:26 -06:00
|
|
|
#include <string>
|
2015-12-19 11:46:01 -07:00
|
|
|
#include <vector>
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2017-02-09 06:07:36 -07:00
|
|
|
#include "Core/IOS/ES/Formats.h"
|
2009-07-05 20:10:26 -06:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
2017-06-06 03:49:01 -06:00
|
|
|
class BlobReader;
|
2014-02-20 17:47:53 -07:00
|
|
|
|
2009-07-05 20:10:26 -06:00
|
|
|
class WiiWAD
|
|
|
|
{
|
|
|
|
public:
|
2016-09-25 15:33:43 -06:00
|
|
|
explicit WiiWAD(const std::string& name);
|
2017-07-04 07:37:41 -06:00
|
|
|
explicit WiiWAD(std::unique_ptr<BlobReader> blob_reader);
|
2017-10-01 07:14:53 -06:00
|
|
|
WiiWAD(WiiWAD&&) = default;
|
|
|
|
WiiWAD& operator=(WiiWAD&&) = default;
|
2016-06-24 02:43:46 -06:00
|
|
|
~WiiWAD();
|
|
|
|
|
|
|
|
bool IsValid() const { return m_valid; }
|
|
|
|
const std::vector<u8>& GetCertificateChain() const { return m_certificate_chain; }
|
2017-02-11 00:57:47 -07:00
|
|
|
const IOS::ES::TicketReader& GetTicket() const { return m_ticket; }
|
|
|
|
const IOS::ES::TMDReader& GetTMD() const { return m_tmd; }
|
2016-06-24 02:43:46 -06:00
|
|
|
const std::vector<u8>& GetDataApp() const { return m_data_app; }
|
|
|
|
const std::vector<u8>& GetFooter() const { return m_footer; }
|
2017-05-14 04:05:43 -06:00
|
|
|
std::vector<u8> GetContent(u16 index) const;
|
|
|
|
|
2009-07-05 20:10:26 -06:00
|
|
|
private:
|
2017-05-14 04:05:43 -06:00
|
|
|
bool ParseWAD();
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2017-07-04 07:37:41 -06:00
|
|
|
bool m_valid = false;
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2017-06-06 03:49:01 -06:00
|
|
|
std::unique_ptr<BlobReader> m_reader;
|
2017-05-14 04:05:43 -06:00
|
|
|
|
|
|
|
u64 m_data_app_offset = 0;
|
2016-06-24 02:43:46 -06:00
|
|
|
std::vector<u8> m_certificate_chain;
|
2017-02-11 00:57:47 -07:00
|
|
|
IOS::ES::TicketReader m_ticket;
|
|
|
|
IOS::ES::TMDReader m_tmd;
|
2016-06-24 02:43:46 -06:00
|
|
|
std::vector<u8> m_data_app;
|
|
|
|
std::vector<u8> m_footer;
|
2009-07-05 20:10:26 -06:00
|
|
|
};
|
|
|
|
}
|