Page 2 of 2

Posted: Wed Mar 22, 2006 6:09 pm
by ENV
hmm I think ive got enough to extract the non compressed file now...

Any ideas on the type of compression used on the others?

Posted: Mon Mar 27, 2006 9:38 am
by ENV
:(

Posted: Wed Aug 16, 2006 11:55 pm
by Savage
Well GAUP looks can unpack the .PAK, i dont' have a sample or similar to try...so..if somebody have the game to test...8D

http://wincmd.ru/plugring/gaup.html

* "Commandos Strike Force" .PAK files (Not decompress)

mm.. looks unpacker not decompressor

Posted: Tue Oct 31, 2006 2:35 pm
by Anatoly Prokofiev
The type of compression, used in PAK files, is a simple Deflate. ZLibEx library can handle such packed blocks with no problem. Each file in PAK archive is stored like this:

@[Real file offset from the main table]:
long PackedBlockSize
long UnpackedBlockSize

Here's a pseudocode to extract one file from _compressed_ PAK.

Get Real_File_Size from the main table
Seek to Real_File_Offset.

Repeat
Read PackedBlockSize
Read UnpackedBlockSize

Read Block
DecompressIt (i.e., using ZDecompress from ZLibEx)
WriteTo_Output

Real_File_Size = Real_File_Size - UnpackedBlockSize
until Real_File_Size<=0

That's all, I guess. Today I managed to decompile (AND recompile) all PAK files from the game. Remember to change "PAKC" header ID to "PAKA", if you want to produce an uncompressed PAK file.

Posted: Sat Nov 04, 2006 3:08 pm
by Mr.Mouse

Code: Select all

Get MW Long 0 ;
Get V1 Long 0 ;
Get V2 Long 0 ;
Get ResNum Long 0 ;
# First loop needed to just find the offset of the first file
SavePos ST 0 ;
For T = 1 To ResNum ;
Get FN String 0 ;
Get ROff Long 0 ;
Get Size Long 0 ;
Get V1 Long 0 ;
Get V2 Long 0 ;
Next T;
SavePos Offset 0 ;
GoTo ST 0 ;
For T = 1 To ResNum ;
Get FN String 0 ;
Get ROff Long 0 ;
Get Size Long 0 ;
Get V1 Long 0 ;
Get V2 Long 0 ;
Math ROff += Offset ;
Log FN ROff Size 0 0 ;
Next T;
This will enable full extraction from the 'A' type PAK files.

Posted: Tue Feb 27, 2007 5:43 pm
by Rheini
Anatoly Prokofiev wrote:The type of compression, used in PAK files, is a simple Deflate.
as always :zzz:
Today I managed to decompile (AND recompile) all PAK files from the game.
So you wrote a tool? Will you release it?

Posted: Fri Apr 06, 2007 12:04 pm
by Anatoly Prokofiev
Wow. I almost forgot about this topic... :)
So you wrote a tool? Will you release it?
No, what's the point? It was a very simple tool - no GUI, no options.
But there is also a good news. I sent a letter to creator of GAUP with a brief description of how to unpack this files. Look at this:

0.4.9.0 PRO (02/11/2006)
Добавлена полная распаковка of Commandos Strike Force .PAK файлов (спасибо Анатолию Прокофьеву).

Added full extraction of Commandos Strike Force .PAK files (thanks to Anatoly Prokofiev).

So, enjoy! ;)

Posted: Sat Apr 07, 2007 10:41 am
by Darkfox
Hmmmm... the big question at this point is if the game recognises the decompressed files or if recompiling the PAK file is relatively simple. Since the compression is simply deflate it seems it would be a simple process to recompress and remake the archive and it would be playable?

I don't own the game myself but it seems that this could be tested perhaps? It is important how easily decompression and recompiling is in relation to if the game would recognise it afterwards... that is, to test that hypothesis for a clear answer if I have to find some way to do so myself.