2013-04-18 03:09:55 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// 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>
|
|
|
|
|
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;
|
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
class WiiWAD
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-03-19 13:59:41 +00:00
|
|
|
WiiWAD(const std::string& _rName);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
|
|
|
~WiiWAD();
|
|
|
|
|
|
|
|
bool IsValid() const { return m_Valid; }
|
|
|
|
u32 GetCertificateChainSize() const { return m_CertificateChainSize; }
|
|
|
|
u32 GetTicketSize() const { return m_TicketSize; }
|
|
|
|
u32 GetTMDSize() const { return m_TMDSize; }
|
|
|
|
u32 GetDataAppSize() const { return m_DataAppSize; }
|
|
|
|
u32 GetFooterSize() const { return m_FooterSize; }
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
u8* GetCertificateChain() const { return m_pCertificateChain; }
|
|
|
|
u8* GetTicket() const { return m_pTicket; }
|
|
|
|
u8* GetTMD() const { return m_pTMD; }
|
|
|
|
u8* GetDataApp() const { return m_pDataApp; }
|
|
|
|
u8* GetFooter() const { return m_pFooter; }
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2013-03-19 13:59:41 +00:00
|
|
|
static bool IsWiiWAD(const std::string& _rName);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
bool m_Valid;
|
|
|
|
|
|
|
|
u32 m_CertificateChainSize;
|
|
|
|
u32 m_TicketSize;
|
|
|
|
u32 m_TMDSize;
|
|
|
|
u32 m_DataAppSize;
|
|
|
|
u32 m_FooterSize;
|
|
|
|
|
|
|
|
u8* m_pCertificateChain;
|
|
|
|
u8* m_pTicket;
|
|
|
|
u8* m_pTMD;
|
|
|
|
u8* m_pDataApp;
|
|
|
|
u8* m_pFooter;
|
|
|
|
|
|
|
|
u8* CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset);
|
|
|
|
bool ParseWAD(DiscIO::IBlobReader& _rReader);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|