XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Jun 28, 2017 10:18 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 466 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 32  Next
Author Message
 Post subject: Re: My quickBMS scripts
PostPosted: Thu Nov 18, 2010 1:07 pm 
Offline
double-veteran
double-veteran

Joined: Sun Apr 20, 2008 2:58 am
Posts: 822
Has thanked: 5 times
Have thanks: 31 times

The contents of this post was deleted because of possible forum rules violation.

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Thu Nov 18, 2010 3:01 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 1:20 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
The contents of this post was deleted because of possible forum rules violation.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 3:15 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 3:25 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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:
  • 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 1: The first file to be written doesn't have any extension. It's the data block before the first found instance of the search string.
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:
# 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

_________________
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 ;)


Last edited by AlphaTwentyThree on Wed Oct 30, 2013 11:32 am, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 4:37 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
The contents of this post was deleted because of possible forum rules violation.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 6:06 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 6:22 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
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.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 7:04 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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.

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?

_________________
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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Nov 28, 2010 8:36 pm 
Offline
advanced

Joined: Thu Jul 01, 2010 1:48 pm
Posts: 56
Has thanked: 22 times
Have thanks: 10 times
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.

Great!Universal scanner :up:


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Nov 29, 2010 11:48 am 
Offline
double-veteran
double-veteran

Joined: Sun Apr 20, 2008 2:58 am
Posts: 822
Has thanked: 5 times
Have thanks: 31 times
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:
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 are
Code:
...
set OFFSET 0x354
...
math SEARCH += 4
....
FindLoc SIZE string "RGHJ" 0 ""



How to convert hex code to C notation format?


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Nov 29, 2010 2:42 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
OrangeC wrote:
How to convert hex code to C notation format?

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.

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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Nov 29, 2010 3:45 pm 
Offline
double-veteran
double-veteran

Joined: Sun Apr 20, 2008 2:58 am
Posts: 822
Has thanked: 5 times
Have thanks: 31 times
Thanks so much man it worked!!

very useful script, would save me and alot of people time :D


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Nov 29, 2010 4:00 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
AlphaTwentyThree wrote:
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.

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?


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.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Nov 29, 2010 4:11 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
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.
Ok, last chance: send me the AT3 file that you can't play.


_________________
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 ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 466 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 32  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group