FSBext - FSB files extractor

Do you know a tool, link or website for working on a specific game files or to help game research? Let's collect them here!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

FSBext - FSB files extractor

Post by aluigi »

http://aluigi.org/papers.htm#fsbext

Tool for extracting the files from FSB archives, used in the FMOD framework.

It supports:
FSB1, FSB2, FSB3, FSB3.1, FSB4 and FSB5

And it has been tested against a huge number of games and different FSB archives.

I have just released a new version, 0.3.3, that fixes the calculation of channels and frequency for FSB5.
Thanks to brendan19 for pointing me on this error.
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: FSBext - FSB files extractor

Post by spider91 »

When i extract this file with -m option and fsbext 0.3.4a i get 0 size output file, with fsbext 0.3.3 everethyng is fine.

http://www114.zippyshare.com/v/Phff1Tx1/file.html
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: FSBext - FSB files extractor

Post by spider91 »

Another bug:

Try to simply rebuild file below without changing sound and output .fsb file will differ from original file. In rebuilded file size on offset 0x54 is wrong - http://puu.sh/nvDSf/4bd70974ba.png

http://www86.zippyshare.com/v/RlpIsdj5/file.html
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

The problem with -m apparently it's just a bug because when mpeg_fix is disabled there are no instructions at all to dump the file.

Anyway for the mp3 files in FSB my suggestion is to use the -M option that dumps all the channels separetely which is a lot better.

The other problem may be related to the rebuilding of multichannel files, I have a note in my TODO about something similar but I don't know if it's the same.

To be honest at the moment the development of fsbext is on-hold mainly because oggs are not supported yet and rebuilding was ok in the past but currently (FSB5) it appears to be useless because the official FMOD tools should do the job.
I have also a note about a certain type32 and the calculation of the number of channels that was encoutered only once.
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: FSBext - FSB files extractor

Post by spider91 »

The other problem may be related to the rebuilding of multichannel files, I have a note in my TODO about something similar but I don't know if it's the same.

Second file i uploaded is mono, not multichannel, so it seems to be another bug with sizes.

Hope you will fix this bugs someday, cause fsbext is wery usefull tool and it would be nice to have stable version without bugs.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

The reason of that different byte in the rebuilt File5817.fsb is simply that fsbext automatically uses padding in the reimported files.
You can find the full details in the source code fsbext.c at line 1131.
So there is nothing to fix.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

Do you plan on adding OggS header for fsb files that use the Vorbis format?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

It will be not supported until a full working source code for "raw ogg chunks" to "ogg vorbis" or another easy solution will be provided.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

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

Re: FSBext - FSB files extractor

Post by aluigi »

AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

Oh, allrighty then...
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

OK, so is there any way to possess all .fsb files at once using a batch mode?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

http://ss64.com/nt/forfiles.html
http://ss64.com/nt/for2.html

Or cygwin "find": find -iname "*.fsb" -exec fsbext {} ;
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

Huh. Thanks for pointing me that out, it'll sure save me from processing each file at a time.
One question though is how can you find the password contained inside these FSB files?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

The type of encryption algorithm allows to see the clear-text password in the original zero bytes.
fsbext automatically show the first bytes of the archive if it's protected by password and you may guess some characters.
Usually I just run "fsbext -E 1 file.fsb" and then I check the generated file with a hex editor, looking moreover at the final bytes.
Then it's just a guess and try till the decryption is perfect.

You can also try guessfsb:
https://www.hcs64.com/vgm_ripping.html
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

Heh. I tried that with an .fsb file and nothing really changed between these two generated files.
Here's a sample.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

That one is not an FSB archive and it's not encrypted.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FSBext - FSB files extractor

Post by AnonBaiter »

^ Well then it's a mystery that the Speech.fsb file has a .fsb container.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

In fact it doesn't have a FSB container.
What you have there is just a sequence of aligned Gamecube ADPCM streams with a header before each stream (for example 0x5622 is just the frequency 22050)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FSBext - FSB files extractor

Post by aluigi »

There were some things that reminded me of Rockstar Table Tennis, where you got this archive?

Code: Select all

endian big
for
    savepos OFFSET
    get DUMMY1 long
    get DUMMY2 long # DUMMY6 + 1
    get FREQUENCY long
    get ZERO long
    get CHANNELS long
    get DUMMY6 long # DUMMY2 - 1
    get DUMMY7 long # 2, interleave?
    getdstring COEFF 0x20
    math SIZE = DUMMY6
    math SIZE / 2
    math SIZE + 1
    math OFFSET + 0x60
    set NAME string ""
    callfunction DUMP_GENH
    math OFFSET + SIZE
    math OFFSET x 0x800
    goto OFFSET
next

# requirements: NAME, OFFSET, SIZE, CHANNELS, FREQUENCY, COEFF
startfunction DUMP_GENH
    endian save CURRENT_ENDIAN
    endian little
    math genhsz = 0x80
    log MEMORY_FILE 0 0
    putdstring "GENH" 4 MEMORY_FILE     // 0    magic
    put CHANNELS long MEMORY_FILE       // 4    channel_count
    put 2 long MEMORY_FILE              // 8    interleave
    put FREQUENCY long MEMORY_FILE      // c    sample_rate
    put 0xffffffff long MEMORY_FILE     // 10   loop_start
    xmath loop_end "((SIZE * 14)/8)/CHANNELS"
    put loop_end long MEMORY_FILE       // 14   loop_end
    put 12 long MEMORY_FILE             // 18   codec
    xmath start_off "genhsz + (CHANNELS * 32)"
    put start_off long MEMORY_FILE      // 1c   start_offset
    xmath header_size "genhsz + (CHANNELS * 32)"
    put header_size long MEMORY_FILE    // 20   header_size
    put genhsz long MEMORY_FILE         // 24   coef[0]
    xmath TMP "genhsz + 32"
    put TMP long MEMORY_FILE            // 28   coef[1]
    put 1 long MEMORY_FILE              // 2c   dsp_interleave_type
    put 0 long MEMORY_FILE              // 30   coef_type
    put genhsz long MEMORY_FILE         // 34   coef_splitted[0]
    put TMP long MEMORY_FILE            // 38   coef_splitted[1]
    get i asize MEMORY_FILE
    for i = i < genhsz
        put 0 byte MEMORY_FILE
    next i
    math COEFF_PTR = 0
    for i = 0 < CHANNELS
        for x = 0 < 16
            getvarchr TMP COEFF COEFF_PTR short
            math COEFF_PTR + 2
            put TMP short MEMORY_FILE
        next x
        #math COEFF_PTR + 0xe    # 0x20 + 0xe = 0x2e
    next i
    append
    log MEMORY_FILE OFFSET SIZE
    append
    log NAME 0 SIZE MEMORY_FILE
    endian CURRENT_ENDIAN
endfunction