DVDFormat: Difference between revisions

From GC-Forever Wiki
Jump to navigation Jump to search
Cyndanera (talk | contribs)
Format Fixing
Cyndanera (talk | contribs)
Updating the Formating Fix
Line 5: Line 5:


== Random Seed List ==
== Random Seed List ==
0 0x0003
    0 0x0003
8 0x0030
    8 0x0030
1 0x7f00
    1 0x7f00
9 0x7001
    9 0x7001
2 0x0006
    2 0x0006
A 0x0060
    A 0x0060
3 0x7e00
    3 0x7e00
B 0x6003
    B 0x6003
4 0x000c
    4 0x000c
C 0x00c0
    C 0x00c0
5 0x7c00
    5 0x7c00
D 0x4007
    D 0x4007
6 0x0018
    6 0x0018
E 0x0180
    E 0x0180
7 0x7800
    7 0x7800
F 0x000f
    F 0x000f


== Burst Cutting Area ==
== Burst Cutting Area ==
Line 36: Line 36:
     // Encrypted(48 Bytes)
     // Encrypted(48 Bytes)
     u64 psn[6]; //BCA mark positions
     u64 psn[6]; //BCA mark positions
// 188 Total Bytes
    // 188 Total Bytes


== Disc Physical Format ==
== Disc Physical Format ==
// Leadin Area
    // Leadin Area
PhysicalFormatInfo m_pfi;
    PhysicalFormatInfo m_pfi;
DiscManufacturingInfo m_dmi;
    DiscManufacturingInfo m_dmi;


struct_PhysicalFormatInfo
PhysicalFormatInfo
{
     u8 reversed[6];
     u8 reversed[6];
     u8 discMagic; // value is -1.
     u8 discMagic; // value is -1.
Line 53: Line 52:
     u8 reversed2[2026];
     u8 reversed2[2026];
     u8 reversed3[6];
     u8 reversed3[6];
};


struct_DiscManufacturingInfo
DiscManufacturingInfo
{
     u8 reversed[6];
     u8 reversed[6];
     u8 unknown1[6];
     u8 unknown1[6];
Line 72: Line 69:
     u8 reversed2[1983];
     u8 reversed2[1983];
     u8 reversed3[6];
     u8 reversed3[6];
};


struct_DataAreaAllocation
DataAreaAllocation
{
     u8 reversed;
     u8 reversed;
     u16 startSector; // 196608
     u16 startSector; // 196608
Line 81: Line 76:
     u16 endSector; // 909487
     u16 endSector; // 909487
     u8 reversed3[3];
     u8 reversed3[3];
}; // 12 Bytes
    // 12 Bytes


== Disc Image Format ==
== Disc Image Format ==
Line 90: Line 85:
     u8 userdata[0]; // application is stored here, including boot file
     u8 userdata[0]; // application is stored here, including boot file


struct_BootHeader
BootHeader
{
    u8 ConsoleID; // G = Gamecube, R = Wii.
u8 ConsoleID; // G = Gamecube, R = Wii.
    u8 Gamecode[2];
u8 Gamecode[2];
    u8 CountryCode;    //J=JAP . P=PAL . E=USA . D=OoT MasterQuest
u8 CountryCode;    //J=JAP . P=PAL . E=USA . D=OoT MasterQuest
    u8 MakerCode[2];
u8 MakerCode[2];
    u8 DiscID;
u8 DiscID;
    u8 Version;
u8 Version;
    u8 AudioStreaming; //01 = Enable it. 00 = Don't
u8 AudioStreaming; //01 = Enable it. 00 = Don't
    u8 StreamBufSize; // For the AudioEnable.
u8 StreamBufSize; // For the AudioEnable.
    u8 unused_1[18];     
u8 unused_1[18];     
    u32 DVDMagicWord; // 3258163005
u32 DVDMagicWord; // 3258163005
    char GameName[64];
char GameName[64];
    u8 unused_2[416];
u8 unused_2[416];
    u32 NKitMagicWord;
u32 NKitMagicWord;
    u32 NKitVersion;
u32 NKitVersion;
    u32 ImageCRC;
u32 ImageCRC;
    u32 ForceCRC;
u32 ForceCRC;
    u32 ImageSize;
u32 ImageSize;
    u32 JunkID;
u32 JunkID;
    u8 unused_3[488];
u8 unused_3[488];
    u32 ApploaderSize;
u32 ApploaderSize;
    u32 ApploaderInit;
u32 ApploaderFunc1;
    u32 ApploaderMain;
u32 ApploaderFunc2;
    u32 ApploaderExit;
u32 ApploaderFunc3;
    u8 unused_4[16];
u8 unused_4[16];
    u32 DOLOffset;
u32 DOLOffset;
    u32 FSTOffset;
u32 FSTOffset;
    u32 FSTSize;
u32 FSTSize;
    u32 MaxFSTSize;
u32 MaxFSTSize;
    u32 FSTAddress;
u32 FSTAddress;
    u32 UserPos;
u32 UserPos;
    u32 UserLength;
u32 UserLength;
    u32 unused_5;
u32 unused_5;
};


struct_BootHeaderInfo
BootHeaderInfo
{
    u32 DebugMonSize;
u32 DebugMonSize;
    u32 SimMemSize;
u32 SimMemSize;
    u32 ArgOffset;
u32 ArgOffset;
    u32 DebugFlag;
u32 DebugFlag;
    u32 DebugOffset;
u32 DebugOffset;
    u32 DebugSize;
u32 DebugSize;
    u32 RegionCode;
u32 RegionCode;
    u32 TotalDisc;
u32 TotalDisc;
    u32 LongFileName;
u32 LongFileName;
    u32 PADSpec;
u32 PADSpec;
    u32 DOLLimit;
u32 DOLLimit;
    u8 unused_6[8148];
u8 unused_6[8148];
    // 8192 Bytes
}; // 8192 Bytes


struct_AppLoader
AppLoader
{
     char revision[16]; // Revision compile date (example "2001/12/17")
     char revision[16]; // Revision compile date (example "2001/12/17")
     u32 entryPoint; // Apploader's entrypoint
     u32 entryPoint; // Apploader's entrypoint
Line 150: Line 141:
     u8 pad[4]; // zeroes
     u8 pad[4]; // zeroes
     u8 code[0]; // PPC code
     u8 code[0]; // PPC code
};


struct_FileSystemTable
FileSystemTable
{
     u32 entityCount;
     u32 entityCount;
     FileSystemEntity* m_entity;
     FileSystemEntity* m_entity;
     StringTable* m_string;
     StringTable* m_string;
};


struct_FileSystemEntity
FileSystemEntity
{
     u8 flags;
     u8 flags;
     u16 filenameOffset;
     u16 filenameOffset;
     u32 fileOffset;
     u32 fileOffset;
     u32 fileSize;
     u32 fileSize;
};


struct_StringTable
StringTable
{
     char name[0];
     char name[0];
     char dummy;
     char dummy;
};

Revision as of 00:51, 16 March 2024

GameCube Disc Format Please Note this is a work in progress doc

XOR Encryption is done using discID and a random seed by the Disc Controller Firmware, Panasonic MN103S

Random Seed List

   0 0x0003
   8 0x0030
   1 0x7f00
   9 0x7001
   2 0x0006
   A 0x0060
   3 0x7e00
   B 0x6003
   4 0x000c
   C 0x00c0
   5 0x7c00
   D 0x4007
   6 0x0018
   E 0x0180
   7 0x7800
   F 0x000f

Burst Cutting Area

   // UserData(64 Bytes)
   u8 optionalInfo[52];
   u8 manufacturerCode[2];
   u8 recorderDeviceCode[2];
   u8 APMRecorderDeviceCode;
   u8 discManufactureDate[2];
   u8 discManufactureTime[2];
   u8 discNumber[3];
   // KeyData(16 Bytes)
   u8 bcakey[8];
   u8 bcaSerial[8];
   // Encrypted(48 Bytes)
   u64 psn[6]; //BCA mark positions
   // 188 Total Bytes

Disc Physical Format

   // Leadin Area
   PhysicalFormatInfo m_pfi;
   DiscManufacturingInfo m_dmi;

PhysicalFormatInfo

   u8 reversed[6];
   u8 discMagic; // value is -1.
   u8 discSizeMinTransferRate; // The value is fixed on 16.
   u8 discStructure; // The value is fixed on 1.
   u8 recordedDensity; // The value is fixed on 1.
   DataAreaAllocation m_dataAreaAllocation;
   u8 reversed2[2026];
   u8 reversed3[6];

DiscManufacturingInfo

   u8 reversed[6];
   u8 unknown1[6];
   u8 randomNumber2[6];
   u8 unknown2[6];
   u8 randomNumber3[6];
   char mediaId[19]; // "Nintendo Game Disk"
   u8 randomNumber4[6];
   u8 bookTypePartVersion; // value must be 1.
   u8 discSizeMinReadoutRate; // The value is fixed on 16.
   u8 discStructure; // The value is fixed on 1.
   u8 recordedDensity; // The value is fixed on 0.
   DataAreaAllocation m_dataAreaAllocation;
   u8 bcaDescriptor; // The value is fixed on 128.
   u8 reversed2[1983];
   u8 reversed3[6];

DataAreaAllocation

   u8 reversed;
   u16 startSector; // 196608
   u8 reversed2;
   u16 endSector; // 909487
   u8 reversed3[3];
   // 12 Bytes

Disc Image Format

   BootHeader m_header; // boot.bin
   BootHeaderInfo m_bi; // bi2.bin
   AppLoader m_apploader; // appldr.img
   FileSystemTable m_fst; // fst.bin
   u8 userdata[0]; // application is stored here, including boot file

BootHeader

   u8 ConsoleID; // G = Gamecube, R = Wii.
   u8 Gamecode[2];
   u8 CountryCode;    //J=JAP . P=PAL . E=USA . D=OoT MasterQuest
   u8 MakerCode[2];
   u8 DiscID;
   u8 Version;
   u8 AudioStreaming; //01 = Enable it. 00 = Don't
   u8 StreamBufSize; // For the AudioEnable.
   u8 unused_1[18];    
   u32 DVDMagicWord; // 3258163005
   char GameName[64];
   u8 unused_2[416];
   u32 NKitMagicWord;
   u32 NKitVersion;
   u32 ImageCRC;
   u32 ForceCRC;
   u32 ImageSize;
   u32 JunkID;
   u8 unused_3[488];
   u32 ApploaderSize;
   u32 ApploaderInit;
   u32 ApploaderMain;
   u32 ApploaderExit;
   u8 unused_4[16];
   u32 DOLOffset;
   u32 FSTOffset;
   u32 FSTSize;
   u32 MaxFSTSize;
   u32 FSTAddress;
   u32 UserPos;
   u32 UserLength;
   u32 unused_5;

BootHeaderInfo

   u32 DebugMonSize;
   u32 SimMemSize;
   u32 ArgOffset;
   u32 DebugFlag;
   u32 DebugOffset;
   u32 DebugSize;
   u32 RegionCode;
   u32 TotalDisc;
   u32 LongFileName;
   u32 PADSpec;
   u32 DOLLimit;
   u8 unused_6[8148];
   // 8192 Bytes

AppLoader

   char revision[16]; // Revision compile date (example "2001/12/17")
   u32 entryPoint; // Apploader's entrypoint
   u32 size; // Size of apploader code
   u32 rebootSize; // Size of reboot code
   u8 pad[4]; // zeroes
   u8 code[0]; // PPC code

FileSystemTable

   u32 entityCount;
   FileSystemEntity* m_entity;
   StringTable* m_string;

FileSystemEntity

   u8 flags;
   u16 filenameOffset;
   u32 fileOffset;
   u32 fileSize;

StringTable

   char name[0];
   char dummy;