2013-04-18 03:09:55 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#ifndef _VOLUME_WII_CRYPTED
|
|
|
|
#define _VOLUME_WII_CRYPTED
|
|
|
|
|
|
|
|
#include "Volume.h"
|
|
|
|
#include "Blob.h"
|
2010-12-22 06:00:36 +00:00
|
|
|
#include "Crypto/aes.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// --- this volume type is used for encrypted Wii images ---
|
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
class CVolumeWiiCrypted : public IVolume
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CVolumeWiiCrypted(IBlobReader* _pReader, u64 _VolumeOffset, const unsigned char* _pVolumeKey);
|
|
|
|
~CVolumeWiiCrypted();
|
|
|
|
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
2009-02-22 13:59:06 +00:00
|
|
|
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
2010-01-14 07:19:10 +00:00
|
|
|
bool GetTitleID(u8* _pBuffer) const;
|
2010-09-08 00:20:19 +00:00
|
|
|
void GetTMD(u8* _pBuffer, u32* _sz) const;
|
2008-12-08 04:46:09 +00:00
|
|
|
std::string GetUniqueID() const;
|
|
|
|
std::string GetMakerID() const;
|
2013-03-03 01:46:55 +00:00
|
|
|
std::vector<std::string> GetNames() const;
|
2008-12-08 04:46:09 +00:00
|
|
|
u32 GetFSTSize() const;
|
|
|
|
std::string GetApploaderDate() const;
|
|
|
|
ECountry GetCountry() const;
|
|
|
|
u64 GetSize() const;
|
2013-04-09 17:58:56 +00:00
|
|
|
u64 GetRawSize() const;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2012-05-04 10:49:10 +00:00
|
|
|
bool SupportsIntegrityCheck() const { return true; }
|
|
|
|
bool CheckIntegrity() const;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
private:
|
|
|
|
IBlobReader* m_pReader;
|
|
|
|
|
|
|
|
u8* m_pBuffer;
|
|
|
|
AES_KEY m_AES_KEY;
|
|
|
|
|
|
|
|
u64 m_VolumeOffset;
|
2010-09-08 00:20:19 +00:00
|
|
|
u64 dataOffset;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
mutable u64 m_LastDecryptedBlockOffset;
|
|
|
|
mutable unsigned char m_LastDecryptedBlock[0x8000];
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|