Formula 1 '97 .PAK ("PACK")

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Formula 1 '97 .PAK ("PACK")

Post by barti »

Recently I got curious about the Metropolis Street Racer compression again, so I started looking for other games by Bizarre Creations that use this format. And sure enough, I stumbled upon the PC game Formula 1 '97. The .PAK files look very similar, header is almost the same except for "PACK" instead of "Pak\x1b".

So I debugged the EXE file, and found that the function at 0x4C7800 looks rather promising. It loads a file and at the end checks if the header starts with "PACK", then calls a function at 0x4429C0 which looks like some kind of a decompression function, but I haven't been successful in wrapping it inside a C executable / QuickBMS script.

I've researched the demo of this game, which is available here:
http://download.cnet.com/Formula-1-97-C ... 18500.html
Last edited by barti on Fri Oct 14, 2016 1:13 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Formula 1 '97 .PAK ("PACK")

Post by aluigi »

It's a very simple compression algorithm, I will implement it in the next quickbms.
In the meantime :)

Code: Select all

set MEMORY_FILE3 binary "\x53\x51\x56\x57\x55\x83\xec\x0c\x89\xc6\x31\xc0\x8a\x46\x02\xc1\xe0\x10\x8d\x1c\x02\x31\xc0\x8a\x46\x01\xc1\xe0\x08\x01\xc3\x31\xc0\x8a\x06\x01\xc3\x83\xc6\x04\x89\x1c\x24\x0f\xb6\x3e\x31\xc0\xc1\xe7\x08\x8a\x46\x01\x01\xc7\x31\xc0\xc1\xe7\x08\x8a\x46\x02\x01\xc7\x31\xc0\xc1\xe7\x08\x8a\x46\x03\x01\xc7\x46\x89\xf9\xb8\x0e\x00\x00\x00\x83\xe1\x03\x31\xed\x29\xc8\x46\x89\x44\x24\x04\xb8\xff\x3f\x00\x00\x46\xd3\xf8\x46\x89\x44\x24\x08\x8d\x46\x01\x85\xff\x7d\x35\x31\xdb\x31\xc9\x8a\x1e\x8a\x08\xc1\xe3\x08\x09\xcb\x8a\x4c\x24\x04\x89\xde\xd3\xfe\x89\xf1\x8d\x70\x01\x8d\x41\x03\x23\x5c\x24\x08\x43\xf7\xdb\x01\xd3\x48\x83\xf8\xff\x74\x11\x42\x8a\x0b\x43\x88\x4a\xff\xeb\xf1\x42\x8a\x1e\x89\xc6\x88\x5a\xff\x3b\x14\x24\x74\x0d\x45\x01\xff\x83\xfd\x1e\x7c\xaf\xe9\x68\xff\xff\xff\x83\xc4\x0c\x5d\x5f\x5e\x59\x5b\xc3"

idstring "PACK"
savepos OFFSET
get SIZE long
get ZSIZE asize
math ZSIZE - OFFSET
comtype "calldll" "MEMORY_FILE3 0 fastcall RET 0 #OUTPUT# #INPUT# #INPUT_SIZE#"
get NAME basename
clog NAME OFFSET ZSIZE SIZE


*edit* made the script simpler
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Re: Formula 1 '97 .PAK ("PACK")

Post by barti »

Great news, and I can now confirm that it's the same algorithm as in Metropolis Street Racer on Dreamcast :)