Important information: this site is currently scheduled to go offline indefinitely by December 1st 2023.
If you wish to donate to attempt the preservation of tools and software somewhere else before it goes down, check the GoFundMe

Just Cause PC .SAB file

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
OrangeC
double-veteran
double-veteran
Posts: 868
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 419 times

Just Cause PC .SAB file

Post by OrangeC »

http://www.filefront.com/16136341/Music%20info.rar

Okay, here are two files one is a header for a raw pcm 22050hz 16bit liittle endian .sab 633MB file with markers for split points, the other file .sob contains the names of the files, since raw pcm is impossible to split in hex is it possible to write like a bms script that splits the tracks?

thanks.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 1286 times
Contact:

Re: Just Cause PC .SAB file

Post by aluigi »

it should be ok but I'm not 100% sure, try it with the other sab/sob files too:

Code: Select all

# Just Cause ONLY FOR MUSIC.SAB/SOB!!!
# script for QuickBMS http://aluigi.org/papers.htm#quickbms

open FDDE SAB 0
open FDDE SOB 1

get CTF2 long 1
get DUMMY long 1
get FILES long 1
get DUMMY long 1
for i = 0 < FILES
    getdstring DUMMY 0x48 1
next i
for i = 0 < FILES
    get NUM long 1
    get NAMESZ long 1
    getdstring NAME NAMESZ 1
    putarray 0 NUM NAME
next i

get CSW2 long
get DUMMY long
get FILES long
get DUMMY20 long
get DUMMYOFF long
get DUMMY23 long
savepos GO_BACK

for EXTRACT = 0 < 2
    goto GO_BACK
    for i = 0 <= FILES
        get FILE_HERE long
        get CHANNELS long
        get FREQUENCY long
        get SIZE long
        get DUMMY long
        get DUMMY long
        get OFFSET long
        if FILE_HERE != 0
            if EXTRACT != 0
                set BITS long 16
                getarray FILENAME 0 i
                set NAME string FOLDER
                string NAME += /
                string NAME += FILENAME
                math OFFSET += BASE_OFF
                callfunction raw2wav 1
            endif
        endif
    next i
    get FOLDERSZ long
    getdstring FOLDER FOLDERSZ
    padding 16
    savepos BASE_OFF
next EXTRACT

startfunction raw2wav
    set MEMORY_FILE binary "\x52\x49\x46\x46\x00\x00\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x61\x74\x61\x00\x00\x00\x00"

    set RIFFSIZE long SIZE
    math RIFFSIZE += 36
    set BLOCKALIGN long BITS
    set AVGBYTES long FREQUENCY
    math BLOCKALIGN /= 8
    math BLOCKALIGN *= CHANNELS
    math AVGBYTES *= BLOCKALIGN

    putvarchr MEMORY_FILE 4 RIFFSIZE long
    putvarchr MEMORY_FILE 20 1 short          # wFormatTag: Microsoft PCM Format (0x0001)
    putvarchr MEMORY_FILE 22 CHANNELS short   # wChannels
    putvarchr MEMORY_FILE 24 FREQUENCY long   # dwSamplesPerSec
    putvarchr MEMORY_FILE 28 AVGBYTES long    # dwAvgBytesPerSec
    putvarchr MEMORY_FILE 32 BLOCKALIGN short # wBlockAlign
    putvarchr MEMORY_FILE 34 BITS short       # wBitsPerSample
    putvarchr MEMORY_FILE 40 SIZE long

    log MEMORY_FILE2 0 44 MEMORY_FILE
    append
    log MEMORY_FILE2 OFFSET SIZE
    append

    math SIZE += 44
    log NAME 0 SIZE MEMORY_FILE2
endfunction
this script is only for music.sab/sob, DO NOT USE with other files!
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 1323 times

Re: Just Cause PC .SAB file

Post by AlphaTwentyThree »

The contents of this post was deleted because of possible forum rules violation.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
Post Reply