2015-03-01 20:42:39 +00:00
|
|
|
#ifndef WIISAVEWRITER_HPP
|
|
|
|
#define WIISAVEWRITER_HPP
|
2013-02-16 04:22:16 +00:00
|
|
|
|
2015-03-01 20:42:39 +00:00
|
|
|
#include "Athena/MemoryWriter.hpp"
|
2013-07-21 03:57:20 +00:00
|
|
|
|
2014-04-20 09:14:15 +00:00
|
|
|
namespace Athena
|
2013-07-21 03:57:20 +00:00
|
|
|
{
|
2013-02-16 04:22:16 +00:00
|
|
|
class WiiSave;
|
|
|
|
class WiiBanner;
|
|
|
|
class WiiFile;
|
|
|
|
class WiiImage;
|
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
namespace io
|
|
|
|
{
|
|
|
|
|
2013-07-21 03:57:20 +00:00
|
|
|
/*! \class WiiSaveWriter
|
|
|
|
* \brief Wii data.bin writer class
|
|
|
|
*
|
|
|
|
* A Class for writing binary data to a wii data.bin file,
|
|
|
|
* all work is done using a memory buffer, and not written directly to the disk.
|
|
|
|
* \sa BinaryReader
|
|
|
|
*/
|
2015-07-08 06:03:08 +00:00
|
|
|
class WiiSaveWriter : protected MemoryCopyWriter
|
2013-02-16 04:22:16 +00:00
|
|
|
{
|
2015-07-08 06:03:08 +00:00
|
|
|
MEMORYCOPYWRITER_BASE();
|
2013-02-16 04:22:16 +00:00
|
|
|
public:
|
2013-07-21 03:57:20 +00:00
|
|
|
/*! \brief This constructor creates an instance from a file on disk.
|
|
|
|
*
|
|
|
|
* \param filename The file to create the stream from
|
|
|
|
*/
|
2013-02-16 04:22:16 +00:00
|
|
|
WiiSaveWriter(const std::string&);
|
|
|
|
|
2013-07-21 03:57:20 +00:00
|
|
|
/*!
|
|
|
|
* \brief writeSave
|
|
|
|
* \param save
|
|
|
|
* \param macAddress
|
|
|
|
* \param ngId
|
|
|
|
* \param ngPriv
|
|
|
|
* \param ngSig
|
|
|
|
* \param ngKeyId
|
|
|
|
* \param filepath
|
|
|
|
* \return
|
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
bool writeSave(WiiSave* save, atUint8* macAddress, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId, const std::string& filepath = "");
|
2013-02-16 04:22:16 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void writeBanner(WiiBanner* banner);
|
2014-06-18 04:51:18 +00:00
|
|
|
atUint32 writeFile(WiiFile* file);
|
2013-02-16 04:22:16 +00:00
|
|
|
void writeImage(WiiImage* image);
|
2014-06-18 04:51:18 +00:00
|
|
|
void writeCerts(atUint32 filesSize, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId);
|
2013-02-16 04:22:16 +00:00
|
|
|
};
|
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
} // io
|
2013-07-21 03:57:20 +00:00
|
|
|
} // zelda
|
2015-03-01 20:42:39 +00:00
|
|
|
#endif // WIISAVEWRITER_HPP
|