Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
terry336
ultra-n00b
Posts: 6
Joined: Tue Mar 29, 2022 10:56 pm

Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by terry336 »

Hello,
I have a bin file of an arcade game from which I would like to extract all the files present (models in nj and njm format, textures in pvr format, etc...) however when I open the bin file with a hex editor, I don't know where exactly these files are located. Is there a bms script that can extract file contents? Or is it possible for someone to develop one for me since I don't have any programming skills.
You will find below the bin file with the two files summarizing the contents of the bin file:
https://drive.google.com/file/d/1diQMDK ... sp=sharing

Thanks for your help! I would very much like to extract the contents of this file.
See ya
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Arcade Game BIN extraction (SSZL archive)

Post by DKDave »

I posted this script on Discord, so I'll add it here too in case anyone else wants to experiment with the files.

Use the script on the .dir file and it will automatically pick up the relevant .fil and .bin files. The files are split into compressed and uncompressed folders, if anybody wants to look at the compressed ones to determine the exact format. The header info "SSZL" suggests LZSS, but it may be some custom variation as I can't determine the exact compression type.

@ikskoks - probably another one to add on the wiki! Let me know if you need the full structure.

dir.zip
You do not have the required permissions to view the files attached to this post.
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by ikskoks »

@ikskoks - probably another one to add on the wiki! Let me know if you need the full structure.
Ok, added. ;)
http://wiki.xentax.com/index.php/Dinosa ... IL_DIR_BIN
http://wiki.xentax.com/index.php/PVR_Image

You can post full structure here and I'll update the wiki later.


Btw, here are more samples from discord in case someone else would like to check this:
https://drive.google.com/file/d/1FKz0vb ... pHFs5/view
User avatar
DKDave
ultra-veteran
ultra-veteran
Posts: 357
Joined: Mon May 06, 2019 6:07 pm
Location: On board the USS Callister
Has thanked: 9 times
Been thanked: 167 times

Re: Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by DKDave »

Here's the structure of the files:

DIR file - this is a list of the main folders

No header, so divide file size by 40 to get number of entries. Each entry is as follows:

uint32 Start file index in FIL file for this folder
uint32 Number of files in this folder
char (32) Full folder path (null-padded to 32 bytes)


FIL file - this is a list of the actual files

No header, files are referenced from the DIR file. Each entry is 44 bytes as follows:

uint32 File offset in BIN file
uint32 File size
uint32 Compression flag (0 = uncompressed, 1 = compressed)
char (32) Filename (null-padded to 32 bytes)


If files are compressed, they begin with a 16-byte header as follows:

char (4) "SSZL"
uint32 Total size of the decompresssed file
uint32 Total size of the compressed file, including this header
uint32 Unknown - maybe some custom value for LZSS decompression
I see a vision rising, dreary, Fading in as children play twilight games, In the town called Ordinary, An eye of light reveals a gateway to doomsday
barncastle
beginner
Posts: 32
Joined: Tue Apr 13, 2021 5:13 pm
Been thanked: 32 times

Re: Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by barncastle »

As DKDave said, compression is probably a variant of LZSS. The final field of the SSZL header is the control value which (usually) denotes a back-reference. If two sequential bytes are control values then the back reference is escaped and a literal is stored instead. There is also a quirk where the back-reference index is decremented if it is larger than the control value but I'm not sure why or if correct.

Example implementation. FYI, this was hand-rolled from file comparisons rather than debugging the game so could have issues but works for all the PVR files from the original sample.
terry336
ultra-n00b
Posts: 6
Joined: Tue Mar 29, 2022 10:56 pm

Re: Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by terry336 »

barncastle wrote: Wed Jul 13, 2022 11:21 am As DKDave said, compression is probably a variant of LZSS. The final field of the SSZL header is the control value which (usually) denotes a back-reference. If two sequential bytes are control values then the back reference is escaped and a literal is stored instead. There is also a quirk where the back-reference index is decremented if it is larger than the control value but I'm not sure why or if correct.

Example implementation. FYI, this was hand-rolled from file comparisons rather than debugging the game so could have issues but works for all the PVR files from the original sample.
Hello, I tried your software, it works for the most of the files, however some nj files and most animations in njm format are unreadable by the Noesis software, are they badly decompressed by your software? Also, I would like to extract the source code of this game rom except that there are only unknown files dating from 1996. So, I wonder if there is no hidden files?

https://1drv.ms/u/s!AvAalMnZzI2LgcMUaZh ... Q?e=9NpphL
terry336
ultra-n00b
Posts: 6
Joined: Tue Mar 29, 2022 10:56 pm

Re: Dinosaur King FIL / DIR / BIN extraction (SSZL archive)

Post by terry336 »

Finally I was able to extract the source code of the first Dinosaur King game in bin format, however I couldn't find any dir and fil files listing the game data files. Can you extract the data from the bin file?

https://mega.nz/file/am4XRDjb#sRJOR3wcY ... fgmbmDMMJA
Post Reply