Join also our Discord channel! Click here.
My quickBMS scripts
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- mega-veteran
- Posts: 314
- Joined: Fri Jun 11, 2010 12:08 pm
- Has thanked: 78 times
- Been thanked: 21 times
Re: My quickBMS scripts
The contents of this post was deleted because of possible forum rules violation.
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
Generic file splitter
This is a VERY powerful script if you encounter a game archive with various files of one type in it but without information table. Happens quite often in PS2 games I realized now. The script searches for occurances of a given string and splits up the file where such an occurance is found.
You find some really useful suggestions for some split types inside the script. Remember to adjust the other variables accordingly of you use one of them (see comments in script).
What you have to adjust:
Note 2: If the search string isn't found, no data is written to disk
Note 3: The last extracted file always stops at the end of the file, so it usually contains more data than what you need.
Note 4: If you have an archive with more than one file type inside (multiple identifiers), run the script multiple times (first on the main archive, then on the extracted files).
Note 4: another use of this script is to split a file by zero blocks. For this, set the search string to the minimum zero block you need and set NEGBIAS to the length of the block you provided. Of course the script won't leave out zeros at the start of the next found split point but as a hint: you can run this script multiple times.
Example to use this as a wave scanner:
set EXT ".wav"
set SIZEBIAS 4
set REV 0
set MINSIZE 0x10 (just estimated)
FindLoc SIZE string "RIFF" 0 ""
This is a VERY powerful script if you encounter a game archive with various files of one type in it but without information table. Happens quite often in PS2 games I realized now. The script searches for occurances of a given string and splits up the file where such an occurance is found.
You find some really useful suggestions for some split types inside the script. Remember to adjust the other variables accordingly of you use one of them (see comments in script).
What you have to adjust:
- set OFFSET # - offset where the first file to be written starts. If you leave it at zero, the script will also write the area before the first occurance of the search string to disk
- set SKIP # - if you want to leave out bytes after the designated searchstring, put that here. Can be negative (e.g. when you don't want to distinguish between RIFF and RIFX files, just search for "WAVEfmt" and set SKIP to -8)
- set NEGBIAS # - if the split identifier is at the end of a file (like stop markers), adjust this to the length of the identifier. E.g. if some file type always ends in 0xFFFFFFFFFFFFFFFF, search for \xff\xff\xff\xff\xff\xff\xff\xff and set NEGBIAS to 8.
- set SIZEBIAS # - STANDARD VALUE IS -1! If you want to extract only one type of file and the file size is given in the header, set this to the according value. With this option, the script works as a file scanner (!).
- set REV 0/1 - if the file size from the above offset is big endian, just set this to 1
- FindLoc SIZE string # 0 "" - String or hex code to be searched. Hex code as always in C notation (see posted script)
Note 2: If the search string isn't found, no data is written to disk
Note 3: The last extracted file always stops at the end of the file, so it usually contains more data than what you need.
Note 4: If you have an archive with more than one file type inside (multiple identifiers), run the script multiple times (first on the main archive, then on the extracted files).
Note 4: another use of this script is to split a file by zero blocks. For this, set the search string to the minimum zero block you need and set NEGBIAS to the length of the block you provided. Of course the script won't leave out zeros at the start of the next found split point but as a hint: you can run this script multiple times.

Example to use this as a wave scanner:
set EXT ".wav"
set SIZEBIAS 4
set REV 0
set MINSIZE 0x10 (just estimated)
FindLoc SIZE string "RIFF" 0 ""
Code: Select all
# generic splitter / scanner
# very powerful for raw ripping
# (c) 2013-10-30 by AlphaTwentyThree of XeNTaX
# script for QuickBMS http://quickbms.aluigi.org
set OFFSET 0 # begin scan here
set SKIP 0x0 # skip bytes at start of search string
# (use negative value if search identifier is after file start)
set NEGBIAS 0x0 # search string at end of file e.g. stop markers (positive value!)
set EXT ".segs" # add this extention
set NAMEPOS "" # if all files are the same type and you know the position of the names
set SIZEBIAS 0xc # offset bias where file size is found
set REV 1 # 0 = leave, 1 = big endian
set MINSIZE 0x4 # minimal size of extracted file
set WRITEOFFSET 0 # toggle between file.ext@offset and file_#
get FSIZE asize
if SKIP < 0
math OFFSET -= SKIP
else
math OFFSET += SKIP
endif
set SEARCH OFFSET
set QUIT 0
set SINGLE 0
set i 0
do
goto SEARCH
#print "searching from offset %SEARCH%"
#FindLoc SIZE string \x7\x0\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77 0 "" # VAG stop marker 1
#FindLoc SIZE string \x7\x0\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x7\x0\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77 0 ""
#FindLoc SIZE string \x00\x07\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77 0 ""
#FindLoc SIZE string \x00\x07\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 0 ""
#FindLoc SIZE string \xC\x3\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 0 "" # VAG stop marker 2
#FindLoc SIZE string \xC\x6\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 0 "" # VAG stop marker 3
#FindLoc SIZE string \xC\x7\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 0 "" # VAG stop marker 4
#FindLoc SIZE string \x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 0 "" # 0x10 zero block
#FindLoc SIZE string \x2\x28\x3\x3\x\x\x\x28 0 "" # ubisoft packet *.ubipack
#FindLoc SIZE string "FUNlXMA2" 0 "" # xma2 container (Men in Black: Alien Crisis)
#FindLoc SIZE string \x8D\x0C\x53\x4F 0 ""
#FindLoc SIZE string \x5D\0\x\x80 0 "" # lzma signature
#FindLoc SIZE string "MUSX" 0 ""
#FindLoc SIZE string "MSFC" 0 ""
#FindLoc SIZE string \xFF\xFF\x0\x0\xFF\xFF\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\xFF\xFF\x0\x0\xFF\xFF\x0\x0 0 "" # Xbox ADPCM silence
#FindLoc SIZE string \x0C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 0 "" # Xbox ADPCM silence
#FindLoc SIZE string \x02\x28\x03\x03\x00\x00\x00\x28 0 "" # ubi sound pack
#FindLoc SIZE string \x48\x00\x00\x0C\x13 0 "" # eaxma stream start
#FindLoc SIZE string \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 0 "" # 32bytes of zeros
#FindLoc SIZE string \x00\x00\x01\xBA\x44\x00\x04\x00 0 "" # PSS movie
#FindLoc SIZE string \x30\x26\xB2\x75\x8E\x66\xCF\x11 0 "" # wmv
#FindLoc SIZE string \x48\x00\x00\x0c 0 "" # EA
#FindLoc SIZE string \x48\x00\x00\x0C 0 "" # EAlayer3
#FindLoc SIZE string "FSB5" 0 ""
#FindLoc SIZE string \x80\x00\x00\x24 0 "" # adx
#FindLoc SIZE string \x51\x5A\x49\x50\x00\x44\x43\x5F\x49\x4E\x46\x4F 0 "" # QZIP (Heavy Rain)
FindLoc SIZE string "segs" 0 ""
#FindLoc SIZE string "Interplay MVE File" 0 ""
#FindLoc SIZE string \x48\x00\x00\x0C\x16\x04 0 ""
if SIZE == ""
set QUIT 1
get SIZE asize
if i == 0
cleanexit
endif
else
#print "split point found at offset %SIZE%"
endif
math SIZE -= OFFSET
if SIZE == 0 # no residual data at start
math i += 1
elif SIZE > 4
if NAMEPOS == ""
get NAME basename
if WRITEOFFSET == 1
string NAME += "@"
string NAME += OFFSET
else
string NAME += "_"
string NAME += i
endif
if i != 0
if SINGLE != 1
string NAME += EXT
endif
endif
else
savepos MYOFF
goto NAMEPOS
get NAME string
savepos NAMEPOS
endif
math OFFSET += SKIP
if QUIT != 1
math SIZE -= SKIP
math SIZE += NEGBIAS
endif
if SIZE >= MINSIZE
if SIZEBIAS > 0
savepos MY
set GO OFFSET
math GO += SIZEBIAS
goto GO
get SIZE2 long
if REV == 1
reverselong SIZE2
endif
goto MY
log NAME OFFSET SIZE2
else
log NAME OFFSET SIZE
endif
print "found %SIZE% bytes file @ %OFFSET% (read from %GO%)"
math i += 1
endif
else
endif
if QUIT != 1
math OFFSET += SIZE
set SEARCH OFFSET
if SKIP > 0
math OFFSET += SKIP
else
math OFFSET -= SKIP
endif
math SEARCH += 4 # needs to be the length of the search string
if SEARCH >= FSIZE
set QUIT 1
endif
endif
while QUIT != 1
Last edited by AlphaTwentyThree on Wed Oct 30, 2013 11:32 am, edited 4 times in total.
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- mega-veteran
- Posts: 314
- Joined: Fri Jun 11, 2010 12:08 pm
- Has thanked: 78 times
- Been thanked: 21 times
Re: My quickBMS scripts
The contents of this post was deleted because of possible forum rules violation.
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
The script already converts msf to playable at3 - that's why it's called msf2at3... dude, look at the files in hex.
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- mega-veteran
- Posts: 314
- Joined: Fri Jun 11, 2010 12:08 pm
- Has thanked: 78 times
- Been thanked: 21 times
Re: My quickBMS scripts
I have a problem with playing at3 files. I install Atrac3 codec, but Winamp, Windows Media Player, Media Player Classic, Sony SoundForge, SonicStage cant play audio.
At3 audio, which normal decode to aa3 cant be played in Media Player Classic.
At3 audio, which cant decode to aa3 can be played in Media Player Classic, but no music.
At3 audio, which normal decode to aa3 cant be played in Media Player Classic.
At3 audio, which cant decode to aa3 can be played in Media Player Classic, but no music.
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
I just checked, I can play the files with Windows Media Player. Where did you download the Atrac codec from? Can you play the file with KMPlayer?Researchman wrote:I have a problem with playing at3 files. I install Atrac3 codec, but Winamp, Windows Media Player, Media Player Classic, Sony SoundForge, SonicStage cant play audio.
At3 audio, which normal decode to aa3 cant be played in Media Player Classic.
At3 audio, which cant decode to aa3 can be played in Media Player Classic, but no music.
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- advanced
- Posts: 57
- Joined: Thu Jul 01, 2010 1:48 pm
- Has thanked: 22 times
- Been thanked: 10 times
Re: My quickBMS scripts
Great!Universal scannerAlphaTwentyThree wrote:gen_split.bms
This is a VERY useful script if you encounter a game archive with various files of one type in it but without information table. Happens quite often in PS2 games I realized now.

-
- double-veteran
- Posts: 865
- Joined: Sun Apr 20, 2008 2:58 am
- Has thanked: 5 times
- Been thanked: 34 times
Re: My quickBMS scripts
AlphaTwentyThree wrote:gen_split.bms
This is a VERY useful script if you encounter a game archive with various files of one type in it but without information table. Happens quite often in PS2 games I realized now. The script searches for occurances of a given string and splits up the file where such an occurance is found.
What you have to adjust:
set OFFSET # - offset where the first file to be written starts. If you leave it at zero, the script will also write the area before the first occurance of the search string to disk
math SEARCH += # - enter the length of the search string here
FindLoc SIZE string "#" 0 "" - String or hex code to be searched. Hex code as always in C notation (see posted script)Code: Select all
get BNAME basename string BNAME += "_" set OFFSET 0 set SEARCH OFFSET math SEARCH += 8 set QUIT 0 for i = 1 goto SEARCH FindLoc SIZE string "\x41\x48\x56\x0\x44\x0\x0\x0" 0 "" if SIZE == "" get SIZE asize set QUIT 1 endif math SIZE -= OFFSET set NAME BNAME string NAME += i log NAME OFFSET SIZE if QUIT != 1 math OFFSET += SIZE set SEARCH OFFSET math SEARCH += 8 # needs to be the lengh of the search string else cleanexit endif next i
Example: if you don't need the information before the first occurance of "RGHJ", which is at OFFSET 0x354, the lines areCode: Select all
... set OFFSET 0x354 ... math SEARCH += 4 .... FindLoc SIZE string "RGHJ" 0 ""
How to convert hex code to C notation format?
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
You can see it inside the script - that \x.. \x.. format, that's C notation. For longer sequences, use byte2hex here: http://aluigi.altervista.org/mytoolz.htm#both (that's what I used for the long headers). But you don't need that for those short search terms as you normally don't search for hex code that's longer than 8 bytes.OrangeC wrote:How to convert hex code to C notation format?
Oh and please don't just quote everything when you're referring to just one tiny subject of the post...

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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks

-
- mega-veteran
- Posts: 314
- Joined: Fri Jun 11, 2010 12:08 pm
- Has thanked: 78 times
- Been thanked: 21 times
Re: My quickBMS scripts
I download Atrac3 codec from here - http://www.free-codecs.com/download/son ... _codec.htmAlphaTwentyThree wrote:I just checked, I can play the files with Windows Media Player. Where did you download the Atrac codec from? Can you play the file with KMPlayer?Researchman wrote:I have a problem with playing at3 files. I install Atrac3 codec, but Winamp, Windows Media Player, Media Player Classic, Sony SoundForge, SonicStage cant play audio.
At3 audio, which normal decode to aa3 cant be played in Media Player Classic.
At3 audio, which cant decode to aa3 can be played in Media Player Classic, but no music.
KMPlayer cant play at3 files.
Maybe I dont fully install Atrac3 codec.
-
- double-veteran
- Posts: 984
- Joined: Mon Aug 24, 2009 10:55 pm
- Has thanked: 75 times
- Been thanked: 640 times
Re: My quickBMS scripts
Ok, last chance: send me the AT3 file that you can't play.Researchman wrote:I download Atrac3 codec from here - http://www.free-codecs.com/download/son ... _codec.htm
KMPlayer cant play at3 files.
Maybe I dont fully install Atrac3 codec.
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


And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks
