Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------
- //--- 010 Editor v6.0.3 Binary Template
- //
- // File: GCI.bt
- // Author: Visual Studio
- // Revision: 1.0
- // Purpose: Dissecting GCI save files
- //--------------------------------------
- BigEndian();
- BitfieldRightToLeft();
- typedef uchar u8;
- typedef uint16 u16;
- typedef uint32 u32;
- typedef uint64 u64;
- typedef struct _GCI_HEADER {
- u8 GameID[3] <comment="Game identifier",bgcolor=cLtGreen>;
- u8 RegionFlag <comment="Region Flag",bgcolor=cLtBlue>;
- u8 CompanyID[2] <comment="Company identifier">;
- u8 pad0 <hidden=true,bgcolor=cLtRed>;
- u8 GraphicFormat <comment="Graphics Format">;
- u8 FileID[0x20] <comment="File identifier",bgcolor=cLtGreen>;
- u32 LastModified <comment="Last Modified Date">;
- u32 GraphicOffset <comment="Graphics Offset">;
- u8 pad1[0x8] <hidden=true,bgcolor=cLtRed>;
- u16 NumBlocksUsed <comment="Number of blocks used">;
- u8 pad2[0x2] <hidden=true,bgcolor=cLtRed>;
- u32 InfoOffset <comment="File info offset">;
- } GCI_HEADER;
- typedef struct _FILE_INFO {
- u8 GameName[0x20] <comment="Game name",bgcolor=cLtGreen>;
- u8 FileInfo[0x20] <comment="File info">;
- } FILE_INFO;
- local u8 graphic_fmt[0x3];
- local u16 graphic_len = 0;
- // header
- GCI_HEADER gci_header;
- // file info
- if(gci_header.InfoOffset > 0)
- FSeek(sizeof(GCI_HEADER) + gci_header.InfoOffset);
- FILE_INFO file_info;
- // graphic
- if(gci_header.GraphicFormat == 0x01 || gci_header.GraphicFormat == 0x05) {
- graphic_fmt = "CI8";
- // CI8 then Graphic [3072] + Palete [512] = Total [3584]
- graphic_len = 0xE00;
- }
- else if(gci_header.GraphicFormat == 0x02 || gci_header.GraphicFormat == 0x06) {
- graphic_fmt = "RGB";
- // RGB5A3 Graphic [6144]
- graphic_len = 0x1800;
- }
- typedef struct _GRAPHIC {
- u8 Graphic[graphic_len] <comment="The save graphic">;
- } GRAPHIC;
- if(gci_header.GraphicOffset > 0)
- FSeek(sizeof(GCI_HEADER) + gci_header.GraphicOffset);
- GRAPHIC graphic;
Advertisement
Add Comment
Please, Sign In to add comment