Quake PAK Format Figured out by Pete McCormick (petra@force.net) I am not responsible for any damage this does, enjoy, and please email me any comments! Pete =Format= Header (4 bytes) signature = 'PACK' (4 bytes, int) directory offeset (4 bytes, int) directory lenght Directory (56 bytes, char) file name (4 bytes, int) file position (4 bytes, int) file lenght File at each position (? bytes, char) file data Description - The signature must be present in all PAKs; it's the way Quake knows its a real PAK file. The directory offset is where the directory listing starts, and the lenght is its lenght. In the actuall directory listing, the three options, 56 bytes of a name, the files position and lenght, are repeating until the running total of the length (increment by 64) is reached. If the directory lenght mod 64 is not a even number, you know their is something wrong. And directories are just handled by a making the name something like "/foobar/yeahs.txt". Short and simple. Tips - Put the directory entry at the end of the file, so if you added a file, you'd just rewrite the small directory entry instead of all the data. Limits - Unknown file limit. Don't create too many though :) I would think around a 1000, prehaps 2000 (in which case, 2048 would be reasonible) Quake1 specifics on PAK files (content wise) If the file '/gfx/pop.lmp' is present and contains a Quake logo (extract from your own pak1.pak file), Quake considers the file a registered. Otherwise, it's a shareware. If it's shareware, the ending screen in 'end1.b! in' is displayed (character, screen buffer colour format). If registered, end2.bin is displayed. Quake2 specifics on PAK files (content wise) I have no clue.