2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2009-07-06 02:10:26 +00:00
|
|
|
|
|
|
|
#include <string>
|
2015-12-19 18:46:01 +00:00
|
|
|
#include <vector>
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2009-07-06 02:10:26 +00:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
|
2014-02-21 00:47:53 +00:00
|
|
|
class IBlobReader;
|
2015-10-03 19:25:43 +00:00
|
|
|
class CBlobBigEndianReader;
|
2014-02-21 00:47:53 +00:00
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
class WiiWAD
|
|
|
|
{
|
|
|
|
public:
|
2015-12-19 18:46:01 +00:00
|
|
|
WiiWAD(const std::string& name);
|
2009-07-06 02:10:26 +00:00
|
|
|
~WiiWAD();
|
|
|
|
|
2015-12-19 18:46:01 +00:00
|
|
|
bool IsValid() const { return m_valid; }
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2015-12-19 18:46:01 +00:00
|
|
|
const std::vector<u8>& GetCertificateChain() const { return m_certificate_chain; }
|
|
|
|
const std::vector<u8>& GetTicket() const { return m_ticket; }
|
|
|
|
const std::vector<u8>& GetTMD() const { return m_tmd; }
|
|
|
|
const std::vector<u8>& GetDataApp() const { return m_data_app; }
|
|
|
|
const std::vector<u8>& GetFooter() const { return m_footer; }
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
private:
|
2015-12-19 18:46:01 +00:00
|
|
|
bool ParseWAD(IBlobReader& reader);
|
|
|
|
static std::vector<u8> CreateWADEntry(IBlobReader& reader, u32 size, u64 offset);
|
|
|
|
static bool IsWiiWAD(const CBlobBigEndianReader& reader);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2015-12-19 18:46:01 +00:00
|
|
|
bool m_valid;
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2015-12-19 18:46:01 +00:00
|
|
|
std::vector<u8> m_certificate_chain;
|
|
|
|
std::vector<u8> m_ticket;
|
|
|
|
std::vector<u8> m_tmd;
|
|
|
|
std::vector<u8> m_data_app;
|
|
|
|
std::vector<u8> m_footer;
|
2009-07-06 02:10:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|