Every GTAIV resource (xtd-textures for example) has got following stucture:
4 bytes - Magic ('RSC')
4 bytes - Type (version - textures has "7")
4 bytes - Flags
<<Data in ZLIB on PC and LZX on XBox360>>
From 'flags' value can be calculated sizes of SysSegment and GpuSegment of unpacked data.
Delphi:
Code: Select all
CpuSegSiz := (flags and $7FF) shl (((flags shr 11) and $F) + 8);
GpuSegSiz := ((flags shr 15) and $7FF) shl (((flags shr 26) and $F) + 8);
Code: Select all
uint systemSegSize = (flags & 0x7FF) << (((flags >> 11) & 0xF) + 8);
uint gpuSegSize = ((flags >> 15) & 0x7FF) << (((flags >> 26) & 0xF) + 8);
http://www.sendspace.com/file/u4dk34