

This means that the data that follows this block has to be (de-)compressed using the lzo1x_decompress_safe routine of the lzo library. This header represents a compression unit. Each compression block can have an arbitrary size, but all of them together have to match the compression data size that is provided in the master header.Ĥ byte - DWORD - suggested decompressed sizeĤ byte - DWORD - size of compressed block It consists of a master header that is followed by a number of compression blocks. The lzo compression stream uses a similar format as was used in the lzo library examples.

The XBOX versions of GTA III and GTA Vice City use lzo1x-999 compression on TXD and DFF files. This format was also used in the PC version of Bully: Scholarship Edition. img file itself has no special structure or header, just all the files pointed by the directory. The total number of entries can be found by dividing the size of the. Size of 32 bytes 4 byte - DWORD - Offset (in sectors)Ģ4 byte - CHAR - Name of the file (null terminated) The directory archive is pretty simple, it contains no header, just the following structure repeated until the end of the file. dir and the content pointed by the directory in the. In this version, the directory and the raw files are stored in separate files, the directory entries are stored in a. By not following this rule, the game might get unstable. This is because the game might read more than one file with a single system call. The format is divided between directory entries, which contains information about the actual files in the img archive, and the actual files, which are stored (usually) unsorted, uncompressed and linear (no directory tree).ĭirectory entries should be in the same order as the files are stored, and there should not be any empty block between files. This means that even a file with only 123 byte content will take up 2 KiB in the archive. Thus values for offset and size have to be multiplied by 2048. Every file contained in the img archive must be sector aligned, where the size of each sector is 2048 bytes. The format reflects sectors of CD-ROMs, improving I/O speed on the storage media.

They have a very simple format and currently exist in multiple versions. GTA's most commonly used archive files are cd images, known by the extension.
