Hitman 3 (2021) .RPKG
-
- Posts: 2
- Joined: Thu Jan 21, 2021 9:49 am
Hitman 3 (2021) .RPKG
Hello,
I want to extract\imports files from a new Hitman game. To localize the game to another language. The method with the last part is not suitable, could you help me?
Example of one of the files (https://goo.su/3vUX)
Sorry for my English
THX
I want to extract\imports files from a new Hitman game. To localize the game to another language. The method with the last part is not suitable, could you help me?
Example of one of the files (https://goo.su/3vUX)
Sorry for my English
THX
Last edited by Den_krot on Thu Jan 21, 2021 2:00 pm, edited 1 time in total.
-
- Posts: 2
- Joined: Thu Jan 21, 2021 9:49 am
Re: Hitman 3 (2021) .RPKG
Fixed the link to the file, it led to the wrong place
(https://goo.su/3vUX)
(https://goo.su/3vUX)
-
- Posts: 1
- Joined: Thu Jan 21, 2021 7:34 pm
Re: Hitman 3 (2021) .RPKG
I would also appreciate it if someone would post a script for HITMAN 3, as I would like to extract the music.
The new magic number is "2KPR", compared to "GKPR" for the previous two Hitman games.
The new magic number is "2KPR", compared to "GKPR" for the previous two Hitman games.
-
- Posts: 88
- Joined: Thu Aug 11, 2016 6:52 pm
Re: Hitman 3 (2021) .RPKG
del
Last edited by LinkOFF on Sat Jan 23, 2021 12:18 pm, edited 5 times in total.
-
- Posts: 136
- Joined: Mon Nov 23, 2020 6:01 pm
Re: Hitman 3 (2021) .RPKG
Just a quick correction from my own observations:
0x00 UInt - "2KPR"
0x04 UInt - version?
0x08 Threebyte - ?
0x0b Short - 0x7878
0x0d UInt - File count
0x11 UInt - Size of file table 1
0x15 UInt - Size of file table 2
File table 1 starts at 0x19 (0x14 bytes per entry)
File table 2 starts at 0xd2b9 (variable entry size)
Data starts at 0x2e669
For file table 1, each entry is as follows:
0x00 UInt64 - Checksum ?
0x08 UInt - File offset
0x0c UInt - always 0 (maybe uncompressed size for any compressed data)
0x10 UInt - File size (some values have bit 31 set)
File table 2 seems to be info about the file types - same number of entries as in table 1, but variable length.
The file data looks to be encrypted.
0x00 UInt - "2KPR"
0x04 UInt - version?
0x08 Threebyte - ?
0x0b Short - 0x7878
0x0d UInt - File count
0x11 UInt - Size of file table 1
0x15 UInt - Size of file table 2
File table 1 starts at 0x19 (0x14 bytes per entry)
File table 2 starts at 0xd2b9 (variable entry size)
Data starts at 0x2e669
For file table 1, each entry is as follows:
0x00 UInt64 - Checksum ?
0x08 UInt - File offset
0x0c UInt - always 0 (maybe uncompressed size for any compressed data)
0x10 UInt - File size (some values have bit 31 set)
File table 2 seems to be info about the file types - same number of entries as in table 1, but variable length.
The file data looks to be encrypted.
-
- Posts: 5
- Joined: Fri May 20, 2016 3:05 pm
Re: Hitman 3 (2021) .RPKG
You know, bumping is just really annoying It's not going to make things go faster.
Format is relatively simple, thanks to @DKDave for sparing me initial trouble I'm just going to copy paste his format and extend it.
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.
I have a program up and running for this, let me finalize that and get it on Github. Otherwise, someone else could make a QuickBMS script out of this. Don't want to spend time on creating one right now.
EDIT:
It's up, you can find the repository here: https://github.com/LennardF1989/HitmanExtractor
You can download the tool here: https://github.com/LennardF1989/HitmanE ... _1_0_0.zip
Be sure to read the README for instructions! To OP I think the bad news right now is that TEXT/LINE files are not extractable yet, there are still some holes in the fileformat. I attempted not trying to decompress them and take the "decompressed file size" as-is, but it didn't yield anything interesting. I'd have to look at the Hitman 2 format to see if there are some hints in there, but maybe someone else can fill in the blanks and make a Pull Request
Format is relatively simple, thanks to @DKDave for sparing me initial trouble I'm just going to copy paste his format and extend it.
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.
I have a program up and running for this, let me finalize that and get it on Github. Otherwise, someone else could make a QuickBMS script out of this. Don't want to spend time on creating one right now.
EDIT:
It's up, you can find the repository here: https://github.com/LennardF1989/HitmanExtractor
You can download the tool here: https://github.com/LennardF1989/HitmanE ... _1_0_0.zip
Be sure to read the README for instructions! To OP I think the bad news right now is that TEXT/LINE files are not extractable yet, there are still some holes in the fileformat. I attempted not trying to decompress them and take the "decompressed file size" as-is, but it didn't yield anything interesting. I'd have to look at the Hitman 2 format to see if there are some hints in there, but maybe someone else can fill in the blanks and make a Pull Request
-
- Posts: 88
- Joined: Thu Aug 11, 2016 6:52 pm
Re: Hitman 3 (2021) .RPKG
LennardF1989, excellent work!
-
- Posts: 47
- Joined: Sun Jun 02, 2019 10:40 pm
Re: Hitman 3 (2021) .RPKG
LinkOFF wrote:LennardF1989, excellent work!
Yea, i'm searching text localization files.
Waiting for quickbms script for extraction and import...
-
- Posts: 88
- Joined: Thu Aug 11, 2016 6:52 pm
Re: Hitman 3 (2021) .RPKG
chunk0.rpkg extraction log:
Due to the first incorrect LZ4 block, subsequent errors occur
Code: Select all
Extraced 174925 files, skipped is 128347. LZ4 decompress errors: 100933
Due to the first incorrect LZ4 block, subsequent errors occur
-
- Posts: 5
- Joined: Fri May 20, 2016 3:05 pm
Re: Hitman 3 (2021) .RPKG
@LinkOFF Is that the result of my tool or something of yours?
Either way, I fixed the extraction issue. My initial thought yesterday was right after all. I took MEWW files as a test now, and they extract fine with a proper header, so everything that skipped with the v1.0.0 should now properly extract. I'll push this when I can. Playing with a Hash-function for a bit.
Either way, I fixed the extraction issue. My initial thought yesterday was right after all. I took MEWW files as a test now, and they extract fine with a proper header, so everything that skipped with the v1.0.0 should now properly extract. I'll push this when I can. Playing with a Hash-function for a bit.
-
- Posts: 88
- Joined: Thu Aug 11, 2016 6:52 pm
Re: Hitman 3 (2021) .RPKG
LennardF1989, your tool. I added the log by try-catch exception in LZ4 decode function. Rest chunks extracted without any errors.
-
- Posts: 136
- Joined: Mon Nov 23, 2020 6:01 pm
Re: Hitman 3 (2021) .RPKG
Good stuff!
I can see the "PRIM" files contain the 3d geometry - just an example from one I got something from:
I can see the "PRIM" files contain the 3d geometry - just an example from one I got something from:
-
- Posts: 5
- Joined: Fri May 20, 2016 3:05 pm
Re: Hitman 3 (2021) .RPKG
Just pushed v1.0.1, will update compiled version accordingly. This fixes the extraction of files that aren't compressed.
@LinkOFF: I didn't extract the FULL chunk yet, also due to sheer the number of files it would generate. If you can get me a bunch of failing offsets on that file, I can specifically investigate them Copy/paste of the log from v1.0.1 should give me enough information to find them in the table headers block.
@LinkOFF: I didn't extract the FULL chunk yet, also due to sheer the number of files it would generate. If you can get me a bunch of failing offsets on that file, I can specifically investigate them Copy/paste of the log from v1.0.1 should give me enough information to find them in the table headers block.
-
- Posts: 88
- Joined: Thu Aug 11, 2016 6:52 pm
Re: Hitman 3 (2021) .RPKG
There is a lot of compressed data in extracted files. Log-file with offsets (lz4 decode exceptions).
-
- Posts: 1
- Joined: Tue Feb 02, 2021 5:11 am
Re: Hitman 3 (2021) .RPKG
Hello everyone!
I really want to access this game's models and textures:
* Will it be possible in the near future to unpack the game archives into proper directories (or to generate a document with real descriptive filenames)? Which utility is best for extracting the game files?
* What is the main model and texture format for this game and which program (plus addon?) is best to load the extracted models?
-
The two unpacking tools I found are a bit confusing... it unpacked thousands of files, but if anyone could at least kindly answer my question about model format+previewing, it couldn't be too too awful previewing thousands of mystery models - oh but how do the textures correspond...... Does that directx ripping program work with this type of game at all then?
Thank you very much to anyone who can possibly provide some insight~
I really want to access this game's models and textures:
* Will it be possible in the near future to unpack the game archives into proper directories (or to generate a document with real descriptive filenames)? Which utility is best for extracting the game files?
* What is the main model and texture format for this game and which program (plus addon?) is best to load the extracted models?
-
The two unpacking tools I found are a bit confusing... it unpacked thousands of files, but if anyone could at least kindly answer my question about model format+previewing, it couldn't be too too awful previewing thousands of mystery models - oh but how do the textures correspond...... Does that directx ripping program work with this type of game at all then?
Thank you very much to anyone who can possibly provide some insight~