The rules have been updated, read them now: Rules!

Hitman 3 .rpkg extractor [Release v1.0.1]

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
LennardF1989
ultra-n00b
Posts: 6
Joined: Fri Dec 31, 2010 12:54 am
Been thanked: 3 times

Hitman 3 .rpkg extractor [Release v1.0.1]

Post by LennardF1989 » Sat Jan 23, 2021 2:56 am

[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.
Last edited by LennardF1989 on Sun Jan 24, 2021 1:06 pm, edited 1 time in total.
Disclaimer: I reverse formats for sports only, I have nothing to gain of it but information on how they work and a feeling of accomplishment... much like finally defeating a pesky boss in Dark Souls :D

YourImaginaryFriend
n00b
Posts: 16
Joined: Mon Mar 14, 2016 10:57 am
Has thanked: 7 times
Been thanked: 2 times

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

Post by YourImaginaryFriend » Sat Jan 23, 2021 10:30 am

Awesome! Hopefully someone will make an extraction tool for meshes and textures

JesWhite
beginner
Posts: 20
Joined: Sun Jun 02, 2019 11:36 pm
Has thanked: 9 times
Been thanked: 1 time

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

Post by JesWhite » Sat Jan 23, 2021 6:00 pm

ty great job but i'm trying to find game text files for localization...
waiting some upgrades...
And i need rpkg import support too.

LennardF1989
ultra-n00b
Posts: 6
Joined: Fri Dec 31, 2010 12:54 am
Been thanked: 3 times

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

Post by LennardF1989 » Sun Jan 24, 2021 1:05 pm

Just pushed v1.0.1, fixing the issue with extracting non-compressed assets.

https://github.com/LennardF1989/HitmanE ... tag/v1.0.1
Disclaimer: I reverse formats for sports only, I have nothing to gain of it but information on how they work and a feeling of accomplishment... much like finally defeating a pesky boss in Dark Souls :D

atomicool
n00b
Posts: 12
Joined: Fri Jun 14, 2019 4:01 pm
Has thanked: 7 times
Been thanked: 1 time

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

Post by atomicool » Fri Feb 05, 2021 12:16 pm

so how to packback?

Spiritovod
n00b
Posts: 12
Joined: Sun Oct 10, 2010 9:44 pm
Has thanked: 2 times
Been thanked: 7 times

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

Post by Spiritovod » Fri Feb 05, 2021 5:40 pm


mono24
ultra-veteran
ultra-veteran
Posts: 573
Joined: Sat Nov 06, 2010 12:27 am
Has thanked: 271 times
Been thanked: 117 times

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

Post by mono24 » Sun Feb 07, 2021 5:49 pm

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

mambox
mega-veteran
mega-veteran
Posts: 189
Joined: Wed Mar 24, 2004 2:06 pm
Has thanked: 5 times
Been thanked: 4 times

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

Post by mambox » Mon Feb 08, 2021 5:02 pm

Hi,
any hints to see how are savegame encrypted?

Post Reply