The Forum is up for sale: XeNTaX Forum looking for new owner
painkiller .pak files
-
Mr.Mouse
- Site Admin
- Posts: 4073
- Joined: Wed Jan 15, 2003 6:45 pm
- Location: Dungeons of Doom
- Has thanked: 450 times
- Been thanked: 680 times
- Contact:
The encryption method:
Oh, a Xor method preceded by a inclusive (the new bit will be set) shift-left of the size (in bytes) of the filename (a size which is saved neatly in the PAK file, right before the encrypted resource name), and subsequently is incremented by either -2, -1, 0, 1, 2 depending on the two different hexadecimal parts of the size of the filename (in bytes) and then by the relative filenumber in the archive (the first file is 1, the second is 2 etc.).
Ok, so if I would write a filename of exactly 255 bytes in length in hexadecimal I would get FF. Hexadecimal is 0, 1...9, a, b, c, d, e, f. F = 15 in decimals. F F = 15 * 16 + 15 = 255. The byte is 255. But the two hexadecimal parts of the byte are F F or 15 15.
So, create a two-dimensional table in which [0, 0] = -2, [0, 1] = -1, [0, 2] = 0, [0, 3] = 1, [0, 4] = 2, [0, 5] = -2, [0, 6] = -1 etc until [15, 15]. (Thus, [1, 0] = -1).
So, to decode, read the size variable (a long, 4 bytes) of the filename first. Multiply it with 2. Add 1. Add the number from the above created table. Add the relative filenumber (the first resource in the archive gets a 1) and you have a variable which you will XOR with the first byte of the filename, the resulting byte is the first byte of the actual filename. Now keep adding two to the XOR-byte before you XOR it with a subsequent byte of the filename (giving you actual bytes of the filename) and repeat it in total until you reach the end of the filename. Voila , you have the decrypted filename string.
If there are any questions, don't hesitate.
Oh, a Xor method preceded by a inclusive (the new bit will be set) shift-left of the size (in bytes) of the filename (a size which is saved neatly in the PAK file, right before the encrypted resource name), and subsequently is incremented by either -2, -1, 0, 1, 2 depending on the two different hexadecimal parts of the size of the filename (in bytes) and then by the relative filenumber in the archive (the first file is 1, the second is 2 etc.).
Ok, so if I would write a filename of exactly 255 bytes in length in hexadecimal I would get FF. Hexadecimal is 0, 1...9, a, b, c, d, e, f. F = 15 in decimals. F F = 15 * 16 + 15 = 255. The byte is 255. But the two hexadecimal parts of the byte are F F or 15 15.
So, create a two-dimensional table in which [0, 0] = -2, [0, 1] = -1, [0, 2] = 0, [0, 3] = 1, [0, 4] = 2, [0, 5] = -2, [0, 6] = -1 etc until [15, 15]. (Thus, [1, 0] = -1).
So, to decode, read the size variable (a long, 4 bytes) of the filename first. Multiply it with 2. Add 1. Add the number from the above created table. Add the relative filenumber (the first resource in the archive gets a 1) and you have a variable which you will XOR with the first byte of the filename, the resulting byte is the first byte of the actual filename. Now keep adding two to the XOR-byte before you XOR it with a subsequent byte of the filename (giving you actual bytes of the filename) and repeat it in total until you reach the end of the filename. Voila , you have the decrypted filename string.
If there are any questions, don't hesitate.
-
Mr.Mouse
- Site Admin
- Posts: 4073
- Joined: Wed Jan 15, 2003 6:45 pm
- Location: Dungeons of Doom
- Has thanked: 450 times
- Been thanked: 680 times
- Contact:
About the article, no, it's in the magazine. It's not online.
About the Painkiller *.PAK progression, I have updated painkiller.dll to be able to replace resources in the GRA. It's not implemented in MultiEx Commander yet, although my personal DLL plugin Tester has shown that it works (I replaced sounds of some creature with those from C&C Generals, and the game used them perfectly).
It makes all the difference if this creature says "We will take what is ours" before it bashes your skull in. 
About the Painkiller *.PAK progression, I have updated painkiller.dll to be able to replace resources in the GRA. It's not implemented in MultiEx Commander yet, although my personal DLL plugin Tester has shown that it works (I replaced sounds of some creature with those from C&C Generals, and the game used them perfectly).
-
Mr.Mouse
- Site Admin
- Posts: 4073
- Joined: Wed Jan 15, 2003 6:45 pm
- Location: Dungeons of Doom
- Has thanked: 450 times
- Been thanked: 680 times
- Contact:
Okay, I just finished a stripped-down version of my plugin-tester and called it "PainFull". Here's the details , a screenshot, and the file. To see the screenshot and file, you must register.
[EDIT] FIXED BUG, SEE NEXT POST FOR FILE!
[EDIT] FIXED BUG, SEE NEXT POST FOR FILE!
readme wrote:PainFull Extractor
Done in 2004 by Mike Zuurman
AKA Mr.Mouse/XeNTaX
*Purpose
Small archiver to extract stuff (and import files one by one)
into *.PAK files from the Painkiller game by DreamCatchers.
Use this for domestic purposes only ! It's a tool for the standard
fan of the game that just wants to mess about with some of the
resources.
>>>> Remember and respect the authors' copyrights on these files! <<<<
If you want to do something big, be sure to contact them first.
*Installation
Install MultiEx Commander (http://multiex.xentax.com) first,
you may not need it, but it will ensure you have dlls that you're gonna need.
Then install the all the files in this zip file in one directory of your choice.
Start with Painfull.exe
*Manual
Just browse to a PAK file of your choice at the left side
of the tool, select it in the file-list, and hit "Open Painkiller PAK".
You will notice the contents (entries) listed to the right.
- Extraction
Just select all files at once, clicking on the top file first
followed by a click on the last while holding down shift.
Alternatively just select the files you want, by holding ctrl.
To extract, click the button below and in between the two lists,
with "<<" on it. Voila. It will extract the files into the current path.
- Replacement
Select a file in the file list that you want to use to replace a file
in the open archive. Second, select the file you wish to replace in the
contents list. Click the ">>" button, and wait until it's finished.
Done.
Important Note! PainFull will automatically import the new file, and will
NOT create a backup. If you want to mess around with any PAK file,
be sure to back it up first and store it somewhere save!
( http://www.xentax.com, 2004 )
Thanks to Mambox for the initial hint!![]()
You do not have the required permissions to view the files attached to this post.
-
Mr.Mouse
- Site Admin
- Posts: 4073
- Joined: Wed Jan 15, 2003 6:45 pm
- Location: Dungeons of Doom
- Has thanked: 450 times
- Been thanked: 680 times
- Contact:
Here's the updated file!
[EDIT]
Version 1.1 available!
Fixes the bug mentioned 2 posts down. (Could not extract from MAPS.PAK). Have fun!
[EDIT]
Version 1.1 available!
Fixes the bug mentioned 2 posts down. (Could not extract from MAPS.PAK). Have fun!
You do not have the required permissions to view the files attached to this post.
Last edited by Mr.Mouse on Fri May 07, 2004 7:42 pm, edited 2 times in total.
