Defense Grid 2 - *.hpz

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Hi! The second part of the series uses another type of archive. It is split till data0089.hpz, I've only included the first few parts: http://*USE_ANOTHER_FILEHOSTING*/c16098e ... 67a/gd2.7z
Thanks for your help!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Defense Grid 2 - *.hpz

Post by aluigi »

AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Hm... it stops at 00087 with an error. :\
I'll upload the complete archives in a bit.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Defense Grid 2 - *.hpz

Post by aluigi »

It was all ok, it's just that there are 20 bytes at the end of the index file that were read by the script.
So you have extracted all the files correctly.
I have updated the script only to avoid the error message (the extracted files are the same).
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Ok, good to know, thanks!
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

On another topic, can you also take a look at the msscmp sound archives? That'd be GREAT!
http://*USE_ANOTHER_FILEHOSTING*/668b2f4 ... /msscmp.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Defense Grid 2 - *.hpz

Post by aluigi »

I see only some "1FCB" files in them but I don'think they are so useful.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Well, the files themselves are decodable with binka2wav but there are file names in the header of the KNAB file starting at 0xc32c.
Do you have the patience to take a look at how to sync them to the 1FCB files? I could close that project for once then. ;)
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Here's what I found out:
- there's an " TSP" identifiert at 0x9778 which seems to mark the beginning of the TOC structure
- the TOC structure consists of 0x3c bytes per file, the offsets are at 0x97f4, 0x9830 and so on, the sizes 0xc bytes after the size
I just can't see the link to the file names at 0xc32c...
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Sorry, I was talking about this file: http://*USE_ANOTHER_FILEHOSTING*/8c64289 ... d2_base.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Defense Grid 2 - *.hpz

Post by aluigi »

*edit* use the script provided by Alpha23
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Something is wrong, I get an error message "can't read 1 bytes"...
INFO_OFF is wrong but I don't know where to get the actual info_off.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

number_of_files is at 0x34 btw.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Got it :)

Code: Select all

idstring "KNAB"
goto 0x14
get OFFSET long
goto 0x34
get FILES long
goto OFFSET
get NAMES_OFF long
get OFFSET long
get DUMMY long
get SIZE long
get NAME basename
string NAME + ".txt"
log NAME OFFSET SIZE
get DUMMY long
get DUMMY long
get DUMMY long
get INFO_OFF long
goto INFO_OFF
for i = 0 < FILES
    get NAME_OFF long
    get DUMMY long
    get OFFSET long
    getdstring DUMMY 0xc
    get SIZE long
    getdstring DUMMY 0x20

    savepos TMP
    goto NAME_OFF
    get NAME string
    goto TMP
    log NAME OFFSET SIZE
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Defense Grid 2 - *.hpz

Post by aluigi »

Well done
happyend
Posts: 157
Joined: Sun Aug 24, 2014 8:54 am

Re: Defense Grid 2 - *.hpz

Post by happyend »

AlphaTwentyThree wrote:Got it :)

Code: Select all

idstring "KNAB"
goto 0x14
get OFFSET long
goto 0x34
get FILES long
goto OFFSET
get NAMES_OFF long
get OFFSET long
get DUMMY long
get SIZE long
get NAME basename
string NAME + ".txt"
log NAME OFFSET SIZE
get DUMMY long
get DUMMY long
get DUMMY long
get INFO_OFF long
goto INFO_OFF
for i = 0 < FILES
    get NAME_OFF long
    get DUMMY long
    get OFFSET long
    getdstring DUMMY 0xc
    get SIZE long
    getdstring DUMMY 0x20

    savepos TMP
    goto NAME_OFF
    get NAME string
    goto TMP
    log NAME OFFSET SIZE
next i



- select the input archives/files to extract, type * or "" for whole folder and
subfolders
- select the output folder where extracting the files
- open input file D:\quickbms6.2\defense_grid2_base.msscmp
- open script D:\quickbms6.2\msscmp.bms
- set output folder D:\quickbms6.2\rip

offset filesize filename
--------------------------------------
00000c5c 3316 defense_grid2_base.txt

Error: incomplete input file 0: D:\quickbms6.2\defense_grid2_base.msscmp
Can't read 1 bytes from offset 3b343b39.
Anyway don't worry, it's possible that the BMS script has been written
to exit in this way if it's reached the end of the archive so check it
or contact its author or verify that all the files have been extracted.
Please check the following coverage information to know if it's ok.

coverage file 0 0% 3420 45466658

Last script line before the error or that produced the error:
29 get NAME string

Press RETURN to quit
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Oh... somehow it worked for me. Can you upload the file? I don't have it anymore...
happyend
Posts: 157
Joined: Sun Aug 24, 2014 8:54 am

Re: Defense Grid 2 - *.hpz

Post by happyend »

AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Defense Grid 2 - *.hpz

Post by AlphaTwentyThree »

Ok this is really strange. My script is brutally wrong but somehow I exracted files with it. No idea how I did that. ;)
Anyway, I'll have to rewrite the whole thing but it's not that obvious... Let's see what I can do. ;)