2013-04-17 21:09:55 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// 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
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2009-07-05 20:10:26 -06:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
|
2014-02-20 17:47:53 -07:00
|
|
|
class IBlobReader;
|
|
|
|
|
2009-07-05 20:10:26 -06:00
|
|
|
class WiiWAD
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-03-19 07:59:41 -06:00
|
|
|
WiiWAD(const std::string& _rName);
|
2009-07-05 20:10:26 -06: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-28 23:23:17 -06:00
|
|
|
|
2009-07-05 20:10:26 -06: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-28 23:23:17 -06:00
|
|
|
|
2013-03-19 07:59:41 -06:00
|
|
|
static bool IsWiiWAD(const std::string& _rName);
|
2009-07-05 20:10:26 -06: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);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|