Initially created to help a guy on ZenHAX, but I guess it can be up here as well.
Source and compiled version can be found here: https://github.com/LennardF1989/HitmanExtractor
Format so far.
Code: Select all
Header: 0x00 String - "2KPR" Skip 9 bytes 0x0d UInt - File count 0x11 UInt - File table 1 size 0x15 UInt - File table 2 size File table 1 immediately follows, loop "File count" times, each entry has: 0x00 UInt64 - Hash (Needs hash to filename mapping) 0x08 UInt - File offset Skip 4 bytes 0x10 UInt - File size (Bit 31 determines if encrypted, if Bit 31 is set, exclude it, eg. using bitshifting with & 0x3fffffff) Assert current offset position is total header size + file table 1 size File table 2 immediately follows, loop "File count" times, each entry has: 0x00 String - Filetype (in reverse, eg. NOSJ is JSON) 0x04 UInt - Additional number of bytes for entry (total size is 0x18 + this value) Skip 4 bytes 0x0C UInt - Decompressed size Skip x bytes - Where x = 0x18 + (Additional bytes) - 0x10 (current offset into entry) Assert current offset position is total header size + file table 1 size + file table 2 size Extraction: Loop through all entries, use File offset and File size (adjusted if encrypted!) from File table 1, use File type for file-extension and decompressed size from File table 2. Compression: If file is encrypted, XOR the bytes with key [0xDC, 0x45, 0xA6, 0x9C, 0xD3, 0x72, 0x4C, 0xAB], then decompress with LZ4.