Quake 2 Demo .PACK file help (new to QuickBMS)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
beastedot9
Posts: 9
Joined: Mon Mar 07, 2016 4:54 pm

Quake 2 Demo .PACK file help (new to QuickBMS)

Post by beastedot9 »

Hello everyone, I am currently trying to learn quickbms and following the tutorial here: http://wiki.xentax.com/index.php?title=DGTEFF

At the end it requires you to analyse the pak0 file from Q2 demo and this is my script for it so far:

Code: Select all

idstring "PACK"
get BASE_OFF long
get ArchiveSize long
goto BASE_OFF
set NUM_OF_FILES 1106

for i = 1 < NUM_OF_FILES
   getdstring NAME 0x10
   get OFFSET long
   get SIZE long
   goto OFFSET
log NAME OFFSET SIZE
next i


It just stays at offset 0 and extracts a bunch of files so I'm really not sure where I'm going wrong with this. If anyone could take the time to help, I'd really appreciate it.

The file in question: https://mega.nz/#!MhhTiBrS!Ng_xeSoYMKLd ... 6uunA559H8

Thank you for reading :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Quake 2 Demo .PACK file help (new to QuickBMS)

Post by aluigi »

1) The length of the names is 0x38 bytes.
2) Remove "goto OFFSET"

To retrieve the number of files there are some solutions (ASIZE is meant to be get ASIZE asize):
1) FILES = (ASIZE - BASE_OFF) / (0x38 + 4 + 4)
2) for BASE_OFF = BASE_OFF != ASIZE
3)
for
savepos TMP
if TMP == ASIZE
break
endif
...
3) endless loop till you get the read error that you can ignore
beastedot9
Posts: 9
Joined: Mon Mar 07, 2016 4:54 pm

Re: Quake 2 Demo .PACK file help (new to QuickBMS)

Post by beastedot9 »

Thank you, I managed to get my first script done thanks to your help :)

Seems I overlooked a few things. If you don't mind me asking, did you document the commands that can be done with quickbms as I'd like to keep them handy for reference purposes during writing scripts. Thank you again for your help and quickbms itself :)

Edit: Nevermind found it in the txt file.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Quake 2 Demo .PACK file help (new to QuickBMS)

Post by aluigi »

Regarding the DGTEFF link, the following is the PDF because the page is blank now:
http://www.xentax.com/downloads/multiex ... W_2004.pdf