2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
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
|
|
|
|
|