2010-12-08 08:26:18 +01:00
|
|
|
#ifndef UIDMAP_H
|
|
|
|
#define UIDMAP_H
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//class for handling the uid.sys in a virtual nand
|
|
|
|
//
|
2010-12-08 08:26:18 +01:00
|
|
|
class UIDmap
|
|
|
|
{
|
|
|
|
public:
|
2010-12-23 17:17:46 +01:00
|
|
|
UIDmap( const QByteArray &old = QByteArray() );
|
2010-12-08 08:26:18 +01:00
|
|
|
~UIDmap();
|
|
|
|
|
|
|
|
//makes sure there are the default entries in the map and that the entries are sane
|
|
|
|
bool Check();
|
|
|
|
|
|
|
|
//returns the uid for the given tid
|
|
|
|
//returns 0 if it is not found. or if autocreate is true, it will be created and the new uid returned
|
|
|
|
//numbers are in host endian
|
|
|
|
quint32 GetUid( quint64 tid, bool autoCreate = true );
|
|
|
|
|
|
|
|
//creates a new uid.sys with the system menu entry.
|
2011-01-18 04:03:08 +01:00
|
|
|
//if addFactorySetupDiscs is anything other than 0, it will add some entries for the setup discs used in the wii factory
|
|
|
|
// addFactorySetupDiscs should be the region code: 0x45=E, 0x50=P...
|
2010-12-10 04:50:08 +01:00
|
|
|
// ( serve no purpose other than to just exist )
|
2011-01-18 04:03:08 +01:00
|
|
|
void CreateNew( quint8 addFactorySetupDiscs = 0 );
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//get th entire uid.sys data back in a state ready for writing to a nand
|
2010-12-08 08:26:18 +01:00
|
|
|
const QByteArray Data(){ return data; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
QByteArray data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UIDMAP_H
|