Harry Potter and the Sorcerer's Stone - unknown compression

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

Harry Potter and the Sorcerer's Stone - unknown compression

Post by AlphaTwentyThree »

Hi folks!

I'm back from my vacation and want to finish a script for the above game's *.hog files ("WART3.0" identifier). The problem once again is an unknown compression method. So far, the script only extracts the compressed files as [filename].comp.
Here's an example archive (Xbox version) and the script: http://s8m3kjliho.1fichier.com/
If more samples are needed, I can provide them.
Thanks for any help! :)

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

Re: Harry Potter and the Sorcerer's Stone - unknown compress

Post by aluigi »

I used my compression scanner with one of the files that seems to contain just german text (so easy to guess if it's correctly decompressed) by removing the first 4 bytes, but no good results.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Harry Potter and the Sorcerer's Stone - unknown compress

Post by AlphaTwentyThree »

Thanks Luigi :)
Any other ideas, Ekey? ;)
Hp4Steam
Posts: 3
Joined: Thu Feb 09, 2017 4:06 am

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Hp4Steam »

Delete
Last edited by Hp4Steam on Sat Feb 29, 2020 9:32 pm, edited 1 time in total.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

Could it be LZ4?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by aluigi »

WART3.00 has been recently supported in my script:
http://aluigi.org/bms/wart3_hps.bms

The compression algorithm was dbpf, also known as xrefpack0
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

The script doesn't work anymore on *.HOG archives from this game ^^
Puterboy1
Posts: 382
Joined: Wed Sep 12, 2018 2:22 am

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Puterboy1 »

Warthog1336 wrote:The script doesn't work anymore on *.HOG archives from this game ^^

Well, as soon as you have found a way of making the sound files playable, will you submit them to www.sounds-resource.com if you please? You'd be doing a great service.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by aluigi »

@Warthog1336
Please provide one of these files.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

Filecutted "HOGDAY.HOG" from Harry Potter and the Sorcerer's Stone (PS2): https://mega.nz/#!r4MQEKgL!6L4s0_nnfKvm ... qv8Gq4Uk_k
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by aluigi »

Are you sure that file is not corrupted?
The NAME_OFF fields are all wrong.
Doesn't have sense that an archive store wrong name offsets.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Acewell »

the name offsets make sense if you start right where the folder names end.
the size of the folder name index and file name index is stored in the header.

i can't really work with file cutted samples so this is all i can give :(

Code: Select all

# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

idstring "\x57\x41\x52\x54\x33\x2e\x30\x30"
get FILES long
get STR_TABLE_OFF long
get NAME_TABLE_SZ long
get FOLDER_TABLE_SZ long
for i = 0 < FILES
    get OFFSET long
    get UNK long //??
    get SIZE long
    get CRCx long //??
    get NAME_OFFSET long
    get FOLDER_OFFSET long
    savepos TMP
    xmath STR_OFF "STR_TABLE_OFF + FOLDER_TABLE_SZ + NAME_OFFSET"
    goto STR_OFF
    get NAME string
    xmath FOLDER_OFF "STR_TABLE_OFF + FOLDER_OFFSET"
    goto FOLDER_OFF
    get FOLDER string
    string NAME p "%s%s" FOLDER NAME
    log NAME OFFSET SIZE
    goto TMP
next i


edit
well i guess my UNK is a ZSIZE according to aluigis script, i can not confirm
compression with filecutted samples so my script doesn't handle that yet. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by aluigi »

Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

It worked perfectly. Thank you aluigi and Acewell.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

Turns out it worked for most of the files but still getting an error for other HOG archives.

The error is at line 41 get NAME string.

Samples: https://mega.nz/#!O08hxKCB!Ht9K7Ml8C262 ... XXMQeVIUdE

The archive can be extracted with Alpha23's script but with compressed files :

Code: Select all

# extracts the *.hog archives from Harry Potter and the Sorcerer's Stone (GC/PS2)
# (c) 2014-07-24 by AlphaTwentyThree of XeNTaX
# script for QuickBMS http://quickbms.aluigi.org

idstring "WART3.00"
get TEST byte
if TEST == 0
   endian big
endif
goto 8
get FILES long
get NAMEINFO long
get SIZE_NAMES long
get UNK long
get SIZE_FOLDERS asize
math SIZE_FOLDERS -= SIZE_NAMES
math SIZE_FOLDERS -= NAMEINFO
get OFF_NAMES asize
math OFF_NAMES -= SIZE_NAMES
append
log MEMORY_FILE NAMEINFO SIZE_FOLDERS
log MEMORY_FILE2 OFF_NAMES SIZE_NAMES
append
for i = 1 <= FILES
   get OFFSET long
   get ZSIZE long
   get SIZE long
   get CRC long
   get OFF_NAME long
   get OFF_FOLDER long
   savepos MYOFF
   goto OFF_FOLDER MEMORY_FILE
   get FOLDER string MEMORY_FILE
   goto OFF_NAME MEMORY_FILE2
   get FNAME string MEMORY_FILE2
   goto MYOFF
   set NAME FOLDER
   string NAME += FNAME
   if ZSIZE == 0
      if SIZE != 0
         log NAME OFFSET SIZE
      endif
   else
      string NAME += ".comp"
      log NAME OFFSET ZSIZE
   endif
next i


Thanks in advance.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by aluigi »

Script 0.2.2.

Basically the problem was that exist 2 versions of this format and there is no easy way to know what version is used, I changed the "guessing" method and now it works.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Warthog1336 »

Thank you!
Stephen999
Posts: 24
Joined: Tue Jan 02, 2018 11:42 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Stephen999 »

@Warthog1336
Hi relating to the same topic do you know how to open the files once extracted such as the BMSH files and BTGA files also???

Thanks in advance :)
Stephen999
Posts: 24
Joined: Tue Jan 02, 2018 11:42 pm

Re: Harry Potter and the Sorcerer's Stone - unknown compression

Post by Stephen999 »

aluigi wrote:Script 0.2.2.

Basically the problem was that exist 2 versions of this format and there is no easy way to know what version is used, I changed the "guessing" method and now it works.


Hello where is the Updated Script also is it a way to convert these two file types???

these files where in the extracted Archive for HPPS PS2