Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Test of archive:
- All files have been compressed with specified compression type and fully rebuilt.
- IMG_FASTMAN92_GTASA_COMPRESSION_TYPE_NONE - 915 MB archive
- IMG_FASTMAN92_GTASA_COMPRESSION_TYPE_ZLIB, highest compression level - 533 MB archive
- IMG_FASTMAN92_GTASA_COMPRESSION_TYPE_LZ4, highest compression level, LZ4 HC actually - 686 MB archive
- -----------------------------------------------------
- Final specification.
- Structure of IMG archive.
- beginning of IMG archive, first header:
- #pragma pack(push, 1)
- struct tImgFastman92GTASAfirstHeader
- {
- DWORD magicID; // VERF
- DWORD archiveFlags; // bits 0-3 archive version (should be 1), bits 4-7 metadata encryption type, bits 8-10 game
- char authorName[12]; // constant value "fastman92" padded with zeros.
- };
- #pragma pack(pop)
- VALIDATE_SIZE(tImgFastman92GTASAfirstHeader, 0x14);
- ------------
- Second header, could be encrypted:
- #pragma pack(push, 1)
- struct tImgFastman92GTASAsecondHeader
- {
- DWORD Check; // constant value 1, after decryption it should have value 1. To check if decryption worked properly.
- DWORD NumberOfEntries;
- char reserved[8]; // for future use, should be NULL now.
- };
- #pragma pack(pop)
- VALIDATE_SIZE(tImgFastman92GTASAsecondHeader, 16);
- Now there comes a list of entries, each entry of type:
- #define IMG_FASTMAN92_GTASA_MAX_FILENAME_LENGTH 39
- #pragma pack(push, 1)
- class tImgFastman92GTASAdirectoryEntry
- {
- public:
- unsigned __int32 PositionInSectors;
- unsigned __int16 OriginalSizeInSectors;
- unsigned __int16 NumberOfPaddedBytesInAlignedOriginalSize;
- unsigned __int16 PackedSizeInSectors;
- unsigned __int16 NumberOfPaddedBytesInAlignedPackedSize;
- unsigned __int32 Flags;
- char Name[IMG_FASTMAN92_GTASA_MAX_FILENAME_LENGTH + 1];
- char Reserved[8]; // should have NULL values when reserved.
- };
- #pragma pack(pop)
- VALIDATE_SIZE(tImgFastman92GTASAdirectoryEntry, 64);
- /////////////////
- Explanation of file flags:
- - bits 0-3, compression type
- - bits 4-7, encryption type
- ///////////////////////////////////////////
- Enumerations:
- Game type (3 bits for this value)
- - 0: GTA SA
- Compression type (4 bits for this value):
- - 0: no compression
- - 1: ZLIB compression
- - 2: LZ4 / LZ4 HC compression
- Encryption type (4 bits for this value):
- - 0: no encryption
- - 1: encryption of variation 1, discouraged
- - 2: encryption of variation 2
- That's all!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement