[SOLVED] Sega Bass Fishing (Wii) data.bin (FBND/0)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

[SOLVED] Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by Wasabi »

1data.bin

2data.bin


Sorry for yet another gimmescript post. And yet again, I'm trying to get models/textures/animations.
The disc structure is as follows (Note CVS dirs, homebutton layers and other garbage files are omitted):

    movie [DIR]
    stream [DIR]
    data.bin
    gbw_sound.brsar
    opening.bnr

As you all can see, it's pretty descriptive and strightforward.
I grabt data.bin into HxD and it's FBND/0 encrypted.
Managed to perform extraction with Sonic2006.bms http://aluigi.zenhax.com/bms/sonic2006.bms
Dump final size it's 370MB vs. 642MB original compressed file, though (no duplicates or such).
Correct me if I'm wrong but that's no possible.

The resulting extracted files are all common Wii formats, with avaliable tools for viewing/edition.
All of the dump files consist in 2D images such as textures, static & animated GUIs (TPL,brlan,brlyt formats).

I'm sure this BIN contains also the meshes for players, bass fish, areas, etc. and their respective
animations and vertex morphs. It also sound reasonable to me, size concerning, that these are the bulk-assets
being ignored by the avaliable script.
Also, I'm 99% sure this data is also in brres common format.

May I ask for script "fix"? (Thanks a lot for the existing one, really appreciate it)
I'm trying experimenting getdstring DUMMY & math XLIMIT different values without success.

Getting this (mainly bass animated skinned models) would be a dream(cast) made true which dates since year 2000.
My grattitude to you all in advance.
Last edited by Wasabi on Wed Feb 27, 2019 12:20 am, edited 1 time in total.
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by Wasabi »

Here's the script I'm using. My suspects are it's finishing before ends scanning the full file, leaving .brres or maybe .arc out of the picture because it doesn't reach the sectors storing those.
I commented the parts which had me experimenting a little, without any success. It's possible making the pc to explode with this? :lol:

Code: Select all

# Sonic 2006 (script 0.2.1)
# script for QuickBMS http://quickbms.aluigi.org

endian big
math VERSION = 1
getdstring SIGN 4
if SIGN == "FBND"
math VERSION = 2
endif
goto 0
for
findloc BASE_OFF binary "\x55\xaa\x38\x2d"
    goto BASE_OFF
    idstring "\x55\xaa\x38\x2d"
    get OFFSET long
    get INFO_SIZE long
    get DATA_OFF long
    getdstring DUMMY 0x10
    math OFFSET + BASE_OFF
    goto OFFSET
    math NAME_BASE = 0
    set PATH string ""
    set NAME string ""
//HERE (?)    math XLIMIT = 0x7fffffff
    putarray 0 0 0
    callfunction EXTRACT
next

startfunction EXTRACT
    string PATH + NAME
    string PATH + /
//HERE (?)    math LIMIT = XLIMIT
    for
        getarray i 0 0
//HERE (?)        if i >= LIMIT
            break
        endif
        math i += 1
        putarray 0 0 i

        get FOLDER short
        if FOLDER & 0x100
//HERE (?)            math VERSION = 2    # Chibi-Robo but I'm just guessing, I don't have Sonic2006 to check compatibility
        endif
        get NAME_OFF short
        if FOLDER == 0
            get OFFSET long
            if VERSION == 1
                get ZSIZE long
            endif
            get SIZE long
            math OFFSET + BASE_OFF
        else
            get ID long
            get XLIMIT long
            if VERSION == 1
                get DUMMY long
            endif
        endif

        if NAME_BASE == 0
            math NAME_BASE = XLIMIT
            if VERSION == 1
                math NAME_BASE * 0x10
            else
                math NAME_BASE * 0xc
            endif
            math INFO_SIZE - NAME_BASE
            math NAME_BASE + OFFSET
            log MEMORY_FILE NAME_BASE INFO_SIZE
            math LIMIT = XLIMIT
        endif
        goto NAME_OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if FOLDER == 0
            set FNAME string PATH
            string FNAME + NAME
            if VERSION == 1
                clog FNAME OFFSET ZSIZE SIZE
            else
                log FNAME OFFSET SIZE
            endif
        else
            callfunction EXTRACT
        endif
    next
endfunction

The commentary about Chibi-Robo was already there, so this script it's towards that game and not Sonic 2006. Am I wrong? Perhaps script database description should be updated? Just suggesting.
Thanks a lot to all the people giving this request a shot.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by aluigi »

The problem is that work-arounds like that XLIMIT usually mean that the format is not 100% covered or there are some versions of the format (like in this case) in which things differ.
The script is complex so it would be difficult to put hands on it again.
Anyway if you can upload the whole archive I can check it, maybe it's just something easy (I doubt but I can try).
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by Wasabi »

aluigi wrote:Anyway if you can upload the whole archive I can check it, maybe it's just something easy (I doubt but I can try).

Here it is, took forever to upload... Thank you very much for look into it, Aluigi. Good luck, crossing fingers here.

data.bin (raw uncompressed):
https://mega.nz/#!y0MADSqI!5kbB67M4vW69WVEE3otDX964Uby3ZbzgEOafI8jXIHs
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by aluigi »

Basically the script scans the archive for the pattern "\x55\xaa\x38\x2d" and extracts the files from there.
There is no TOC handling, I don't even know if there is a TOC in the archive.
Therefore there is nothing I can do on the script.
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by Wasabi »

aluigi wrote:Therefore there is nothing I can do on the script.

It's the thought that counts, thank you very much for trying.
Those Sega pals know what they're doing when comes to protecting data eh?
There's lots of Sega titles which never had been open-sesamed before. Quickly comes to my mind Virtua and House of the Dead series, while other titles like Shenmue had to wait until recent MT5 model viewer (Shenmunity, no Shenmue2 MT7 though).
I've been waiting more than a decade to get Virtua Fighter 1&2 capsule toys... SEEE-GAAA!

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

Re: Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by aluigi »

I was double-checking the script and data.bin and I don't think there is something really wrong.

The format is a mess, that's sure :) it's a sort of ISO-like image with chunk names like BCV0, CROW, EOCK, KIND and so on (some variants don't even start with FBND!).
Handling them is a waste of time so the solution adopted by the script is simple and clever because it skips all this data and directly reads the directory entries that start with that 4 bytes pattern.

As far as I can see there are probably also some duplicated files that may take some space, all those chunks and ISO-like entries take space too, the alignment is small so it doesn't affect the taken space.

quickbms has a very useful option that allows to dump the non-extracted data but it can't be used here due to the "scanner" used for finding the directory entries.

So I made a simple script that takes the output generated by the script and dumps all the data in the "middle".
The result is that most of these data is just padding and entries that must be ignored.

But there are also very few big files and by what I have noticed all these files are "bres" files which is a known format seen various times on the forum.

Long story short I decided to update the script for dumping the (2048-bytes aligned) data in the middle in case someone wants to analyze it.
Wasabi
Posts: 29
Joined: Thu Jul 30, 2015 5:39 pm

Re: [SOLVED] Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by Wasabi »

Thank you very much, sir. Your updated script did it!
In the trash folder theres lot of files about 3-15kb which are... well, trash. BUT some files ranging from 3 to 15MB are the model containers and I'm enjoying them in brresviewer right now.
For example, 000005bd.bcv stores all stage elements. Judgin for the polycount those are the classic Dreamcast assets, double yay!
EDIT: models are animated :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [SOLVED] Sega Bass Fishing (Wii) data.bin (FBND/0)

Post by aluigi »

I forgot to say that some BCV files in the trash folder may contain "bres" data, usually they are the big ones.