Page 1 of 8

painkiller .pak files

Posted: Fri Apr 16, 2004 10:35 am
by burzum
Is there support planned for painkiller?

The 1st single player demo use a different pak format than the 2nd one (which is the same as the final game).

cheers.

Posted: Tue Apr 20, 2004 11:35 am
by Mr.Mouse
Soon I will start to take a look at it. :)

Posted: Thu Apr 22, 2004 10:16 am
by mambox
I have the game and also interested to unpack those files.
not for the contents but to learn.

maybe can you (Mr.Mouse) post a small tutorial on how you reverse the pack process?

i'm sure others people here would be interested to learn instead to use like common users..

Hope nothing unpleasant in my post :eek:

thanks!

Posted: Mon Apr 26, 2004 10:12 pm
by Guest
I would like a tutorial also.

thanks :(

Posted: Tue Apr 27, 2004 2:52 pm
by Mr.Mouse
mambox wrote:I have the game and also interested to unpack those files.
not for the contents but to learn.

maybe can you (Mr.Mouse) post a small tutorial on how you reverse the pack process?

i'm sure others people here would be interested to learn instead to use like common users..

Hope nothing unpleasant in my post :eek:

thanks!
Yeah, I have been thinking about doing something along those lines. Mind you, at the beginning of 2003 I wrote a two-page How-To on this very subject for the Dutch hardcopy magazine PCZone, but hey, that's in Dutch, so unless you understand the language, that won't help you out. :wink: Anyway, an English version is on my to-do list.

Posted: Tue Apr 27, 2004 3:39 pm
by mambox
maybe a translator can help a bit :)

are those pages avail online?

about painkiller i'm almost sure its a xor encryption but enough skill to manage rip the routine to convert the files :(

not only time to use but time to learn also.

greets!

Posted: Tue Apr 27, 2004 8:09 pm
by Mr.Mouse
Actually no, the resources in there are packed using unzip32.dll or some other standard PKZip tool, but the file uses it's own format to store the variables PKZip would need. .

I'm working on a way to either convert/reconvert the *.PAK <> PKZip (so you can open them using WinZip) or a MultiEx Commander implementation. :wink:

EDIT
More specifically, it turns out the *.PAK files are actually complete *.ZIP files, but some of the "PK" identification tags have been altered. I will write a converter that will be able to flip between the two states. I just keep being surprised at the trouble these game programmers go through to find yet another package format. In this case, they betrayed the PKZip-format-with-a-twitch all too easily. ;) I don't really understand why they do this. The MOD community would probably love to use their base as a way forward, and they could have just used a real standard zip format to be used. Like the Quake3 engine does, a simple rename of the Quake3.PAK files to .ZIP will do the trick. Oh well. :|

Posted: Wed Apr 28, 2004 2:11 pm
by mambox
In the first demo,.pak was altered pkzip file,another curious guy brought the way to get it back but all has changed,at least in the retail version,the pak version seem xored.

I was looking during a debug session the way it changed some xored ascii back to a more readable text.

but a bit too complicated to reverse the whole scheme for me :)

anyway thanks for the time spent!

Posted: Thu Apr 29, 2004 6:45 am
by Mr.Mouse
mambox wrote:In the first demo,.pak was altered pkzip file,another curious guy brought the way to get it back but all has changed,at least in the retail version,the pak version seem xored.
OMG Why did you not say this before? If you already knew that the demo version was an altered zip file, I needn't have looked into that. :| :)

I do not have access to any retail *.PAK files, so I won't be able to check em out. :?

Posted: Thu Apr 29, 2004 8:20 am
by mambox
Sorry,i tought that you'll see retail package.

anyway 2 demos are out,the first from feb.04.

data\levels.pak was:
50 61 69 6E-50 61 63 6B-00 00 33 98-50 30 00 00 PainPack 3ÿP0
00 00 00 00-00 00 00 00-00 00 0A 00-00 00 43 32 â—™ C2
4C 35 5F 54-6F 77 6E 2F-05 06 03 04-14 00 04 00 L5_Town/♣♠♥♦¶ ♦
08 00 A7 9E-50 30 9F 91-1C 4D C7 02-00 00 59 07 ◘ º₧P0ƒæ∟M╟☻ Y•
00 00 1A 00-00 00 43 32-4C 35 5F 54-6F 77 6E 2F → C2L5_Town/
43 32 4C 35-5F 54 6F 77-6E 2E 43 4C-65 76 65 6C C2L5_Town.CLevel

this one is an altered zip but PK authors didnt liked that someone can reverse to a zip so they improved the second demo version:
same file:

01 FC F8 01-00 78 01 8D-54 DB 6E DA-40 10 7D AF ☺â

Posted: Thu Apr 29, 2004 8:51 am
by Mr.Mouse
How big is that file in bytes you are talking about?

Posted: Thu Apr 29, 2004 9:47 am
by Guest
there is 2 demos!
this is the single player demo 2 it have have the same pak format than retail version.
http://www.gamershell.com/download_5522.shtml

Posted: Thu Apr 29, 2004 10:07 am
by mambox
3,981,827 Levels.pak
1,060,767 LScripts.pak
1,202,744 Maps.pak
3,132,070 Models.pak
388,396 Scripts.pak
447,678 Shaders.pak

or as said in the second version files are same as retail (i mean encryption)

Posted: Thu Apr 29, 2004 10:17 am
by Mr.Mouse
Right, well, I figured it out almost completely. The PAK format now uses ZLib instead of PKZip compression. I have only to figure out how it encrypts the names of the resources and we're done.

Posted: Thu Apr 29, 2004 4:29 pm
by mambox
Mr.Mouse wrote: I have only to figure out how it encrypts the names of the resources and we're done.
that's what i can't find!

found some occurence of xoring in lscripts.pak

search:Pyvjhxl
xor P with 19=C
xor y 21=l
v 23=a

and so on xor 19+2 and you'll find Classes

but i'm lost further...that's why i required some help on teaching from you as you know the reverse much better than me :)

and why not to learn instead using as dead-user?