Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
gw2_reverse/misc/templates/PackFile.bt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
72 lines (67 sloc)
2.18 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct PackFile(uint32 iOffset, uint32 iSize) | |
| { | |
| struct | |
| { | |
| char magic[2]; | |
| uint16 version; | |
| uint16 zero; | |
| uint16 headerSize; | |
| char type[4]; | |
| } header; | |
| while (FTell() < iOffset + iSize) | |
| { | |
| struct | |
| { | |
| struct | |
| { | |
| char magic[4]; | |
| uint32 chunkSize; | |
| struct | |
| { | |
| uint16 version; | |
| uint16 headerSize; | |
| uint32 offsetToOffsetTable; | |
| } chunkInfos; | |
| } header; | |
| if (header.chunkInfos.offsetToOffsetTable != 0) | |
| { | |
| ubyte data[header.chunkInfos.offsetToOffsetTable]; | |
| struct | |
| { | |
| uint32 nbOfOffsets; | |
| uint32 offsets[nbOfOffsets]; | |
| } offsetTable; | |
| } | |
| else | |
| { | |
| ubyte data[header.chunkSize - 8]; | |
| } | |
| if ((FTell() - startof(chunk)) < (header.chunkSize + 8)) | |
| { | |
| ubyte unknown[header.chunkSize + 8 - (FTell() - startof(chunk))]; | |
| } | |
| } chunk; | |
| } | |
| }; | |
| local uint32 lPackFileChunkLoopIndex<hidden=true>; | |
| local uint32 lPackFileOffsetLoopIndex<hidden=true>; | |
| void highlightOffsets(const PackFile& iPackFile) | |
| { | |
| SetBackColor(cLtAqua); | |
| lPackFileChunkLoopIndex = 0; | |
| while (exists(iPackFile.chunk[lPackFileChunkLoopIndex])) | |
| { | |
| if (exists(iPackFile.chunk[lPackFileChunkLoopIndex].offsetTable)) | |
| { | |
| lPackFileOffsetLoopIndex = 0; | |
| while (lPackFileOffsetLoopIndex < iPackFile.chunk[lPackFileChunkLoopIndex].offsetTable.nbOfOffsets) | |
| { | |
| FSeek(startof(iPackFile.chunk[lPackFileChunkLoopIndex].data) + iPackFile.chunk[lPackFileChunkLoopIndex].offsetTable.offsets[lPackFileOffsetLoopIndex]); | |
| uint32 highlightedOffsets; | |
| lPackFileOffsetLoopIndex = lPackFileOffsetLoopIndex + 1; | |
| } | |
| } | |
| lPackFileChunkLoopIndex = lPackFileChunkLoopIndex + 1; | |
| } | |
| SetBackColor(cNone); | |
| } |