//-------------------------------------- //--- 010 Editor v2.0 Binary Template // // File: Jukebox.grs-Parser // Author: l_e // Revision: 0.1 //-------------------------------------- typedef struct{ UINT Size; UCHAR Type[4]; if (Size >0){ // Fileformat allows empty blocks BYTE Data[Size]; } UINT CRC; } PNGBLOCK; typedef struct{ BigEndian(); UCHAR Signature[8]; //Didn't bother checking the PNG-signature.. PNGBLOCK block; //.. nor for valid block-id's etc while (block.Type != "IEND"){ //Number of blocks is unknown, but IEND is the last one PNGBLOCK block; } LittleEndian(); } PNG; typedef struct{ UINT DEADBEEF; // 0xDEADBEEF UINT Size; // Size of Block WORD Format; // BYTE Data1[2]; if (Format == 0x02){ // (atleast) PNG BYTE Data2[8]; UINT ImageSize; UINT Reserved; // 0xFFFFFFFF PNG Imagefile; // PNG-file if (ImageSize-sizeof(Imagefile)>0) BYTE Pad; } else BYTE Data2[Size]; } DIRBLOCK; typedef struct{ UINT BEEFBEEF; // 0xBEEFBEEF LittleEndian(); UINT Size; // Size of the whole block UCHAR Desc[32]; // Description string (ascii) } GRSBLOCK; LittleEndian(); local uint tag; while (!FEof()){ tag = ReadUInt( FTell() ); if (tag == 0xBEEFBEEF){ GRSBLOCK blk; } else if (tag == 0xDEADBEEF){ DIRBLOCK Dir; } } //--------------------------------------