[mini-guide]Understanding the .Pak file

12/02/2007 02:35 Sillyrabbit#1
If you opened this looking for hacks then please leave this thread. This thread was created to give the average player a bit more understanding on what is exactly a .pak file.

Created By: Namek303






What is the .Pak file?

The .Pak file is the basic instructions that the client(1) uses to make it's own decisions within the game. This file is needed to take a strain off the busy server(2).


I still don't understand the concept of a .pak file.

Well we can explain the .pak file like this. Lets pretend you decide to move to a new home on the other side of town.
Only a moron will take each item in his house one at a time to his new home.
The average person puts it in a box to take to the house.
Well in this case the box is the .pak file and the items in your house is the contents inside the .pak file.
The reason most people can't open the .pak file without a hex editor(3) is because the box is sealed and we need a way to open it. in this case a hex editor would be like cutting a small hole in the box and having limited access into what you can do with the items in the box.

But a decompiler(4) is like getting a knife and opening the box and laying out all your items on the floor so you can do as you see fit.

To recompile something you would need to find out what method they used to compile it in the first place so everything goes in smoothly. Followed by sealing the box(.pak file).

There is another version of a .pak file. It does not work the same as a pak file but the concept is the same. I am referring to a winzip file or a .rar file.
The only difference between a .pak file and a .rar file is that we can easily compile and decompile a .rar files since we have been given the tools.

Why can we only edit it with a hex editor?
Well the reason is because no one managed to release a compiler that works properly.

Also there would be issues if we try to recompile the files after we edit it.
If we make changes for example change a file something from 'true' to 'false' then notice that true only has 4 characters and false has 5 characters.

a simple change like that changes the file size and will lead to 2moons not working properly and it might not even start.

Is a .Pak compiler possible?
Yes! it is, but most people would not edit things properly and if they try to recompile, chances are 2moons will not accept that pak file anot give you some error when you start 2moons.


Can you provide an example of another form of compression type so that i can further under stand this?

Well a prime example of BAD compression is ipod games. if you actually get it and rename the extension from .ipg to .zip then you can extract all its contents. Thats another way of doing it. BUT sadly a method like this does not work for the .pak file.






Any questions. I will answer to my best knowledge or maybe another forum member can help too. PLEASE note this thread was not created to teach you how to hack or how to edit the .pak file. ONLY understand it.




word bank
1- The client is the program that the end user (you) use to interpret the game data. essentially it is the game.

2-The server is where all the important data is stored for the game. The client sends and receives data from the server.

3- A program used to edit a file, it is an advance form of notepad.

4- a program used to extract files from another compressed file, in this case the .pak file.
12/02/2007 11:49 darkwang#2
Thank you for the knowledgeable insight into the workings of a pak file and how the average joe can easily relate to the way you explained everything! Very helpful.
12/02/2007 14:45 shy1524#3
nice tuto...!!!!
12/02/2007 20:14 lurkingdevil#4
good job
03/06/2008 21:37 cheat_who#5
:)good job
03/07/2008 22:09 caiocaio#6
are we playing inside a box ? just kidding :P Great job Namek
03/08/2008 01:20 syberx#7
User Friendly explanation indeed
03/08/2008 13:27 newbmember#8
This is a nice tut, but can you show us how to use text editor to edit monster/code.
03/27/2008 09:23 edman3#9
Very usefull for the people out there that didn't have this information.
03/27/2008 19:05 ThoX#10
Thx this helped a bit :)
04/09/2008 17:35 s3ko#11
plz pt dowload winhex im not find in net
when i find he is not free
what should i do
04/10/2008 00:14 Jon8c#12
First of all, using Google, you can find the download for the trial. Then, search around the forums for the 6-line registration thing. And there you have it, a fully working WinHex.
04/10/2008 06:12 s3ko#13
when a open data.pak i can see only =~?Ž=€'ò›tAn?Œ="3DŒ1en?=a€2F„0‰ n?=a&; n?Ž=i3w0n?Ž=…Ž”Q0%n?='B2R1o ?=S)
1
im looking for numbers of mobs
what i do now?
04/10/2008 22:45 rafalorda#14
Hello im NEW ;)
What are PAK, PK3 & PK4 files?

A PK3 (PK4 for Doom 3 games) or 'pak' file is basically a ZIP or RAR archive which uses the 'pk3' file extension instead of *.zip or *.rar. It's not automatically recognised by either WinZip or WinRar, this usually has to be assigned to either application; right click on a current PK3 file and select open with, in the dialogue that appears select WinZip or WinRAR as the application of choice to open these files by default.



How do I create a PAK/PK3/PK4 file
There are a couple of ways to create PK3 or PAK files for games using idsoftware technology, including the recently released Doom 3. The two main ways are to either pack up the contents of a folder or pack folders sitting on the root drive letter. Each works just as well as the other but are the result of different working methods when you create the assets. The most common of the two is to pack up the contents of a folder so that will be explained below.

SOURCE :
Code:
http://www.katsbits.com/htm/tutorials/creating_pk3_files.htm#create_pk4

OTHER SOURCE

Extension: PAK
Program and/or Extension Function [What's This?]
Compressed Archive File
A .PAK file acts like a .ZIP archive, it contains many different files within the archive, and can be accessed via the game it is associated with. Files within the archive are often read only. Note: .PAK files are used with many different Quake Engine games.

SOURCE:
Code:
http://filext.com/file-extension/PAK



SORRY FOR MY ENGLISH but if we takes it in theory our CLIENT .PAK file we can UN-PACK and SPLIT it back if we save good CAPACITY in MBytes.
04/11/2008 01:26 Jon8c#15
@s3ko, don't search for numbers. You're better off looking for weird words, like monsters' names.
@rafa, I don't know what all teh bold stuff is about, but yes, we can unpack it (already has been done). but, we can't exactly repack it. If add or remove just one value into/from the data.pak, it won't work. Dekaron.exe reads it at specific offsets for specific info. You're better off using WinHex anyway.

EDIT: For those that care, according to Cosmos, dekaron.exe doesn't read the data.pak at specific offsets. It refers to data.hd for position info. Not entirely sure if this is correct, but it's another possibility.