Page 1 of 1

Hitman 3 .rpkg extractor [Release v1.0.1]

Posted: Sat Jan 23, 2021 2:56 am
by LennardF1989
[Update 24/1/2020] v1.0.1 released!

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.

Re: Hitman 3 .rpkg extractor [Release v1.0.0]

Posted: Sat Jan 23, 2021 10:30 am
by YourImaginaryFriend
Awesome! Hopefully someone will make an extraction tool for meshes and textures

Re: Hitman 3 .rpkg extractor [Release v1.0.0]

Posted: Sat Jan 23, 2021 6:00 pm
by BoomBookTR
ty great job but i'm trying to find game text files for localization...
waiting some upgrades...
And i need rpkg import support too.

Re: Hitman 3 .rpkg extractor [Release v1.0.0]

Posted: Sun Jan 24, 2021 1:05 pm
by LennardF1989
Just pushed v1.0.1, fixing the issue with extracting non-compressed assets.

https://github.com/LennardF1989/HitmanE ... tag/v1.0.1

Re: Hitman 3 .rpkg extractor [Release v1.0.1]

Posted: Fri Feb 05, 2021 12:16 pm
by atomicool
so how to packback?

Re: Hitman 3 .rpkg extractor [Release v1.0.1]

Posted: Fri Feb 05, 2021 5:40 pm
by Spiritovod

Re: Hitman 3 .rpkg extractor [Release v1.0.0]

Posted: Sun Feb 07, 2021 5:49 pm
by mono24
YourImaginaryFriend wrote: Sat Jan 23, 2021 10:30 am Awesome! Hopefully someone will make an extraction tool for meshes and textures
viewtopic.php?p=171085#p171085

Re: Hitman 3 .rpkg extractor [Release v1.0.1]

Posted: Mon Feb 08, 2021 5:02 pm
by mambox
Hi,
any hints to see how are savegame encrypted?