READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

My quickBMS scripts

Coders and would-be coders alike, this is the place to talk about programming.
OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: My quickBMS scripts

Post by OrangeC » Fri Dec 31, 2010 3:58 am

Hello alpha just a suggestion on your stereo XMA header script,is it possible to add an offset option so you can specify the offset of the xma stream for xma files with custom non riff headers?

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: My quickBMS scripts

Post by AlphaTwentyThree » Fri Dec 31, 2010 2:14 pm

add_header_XMA.bms
Adds an XMA RIFF header that is compatible with toWAV. Needed functions: func_str2num.bms

Code: Select all

# header_adder_XMA.bms
# Add XMA1 RIFF header to headerless XMA1 stream (decodable with toWAV)
# 
# If the headerless stream has the format NAME@FREQ[m/s] (e.g. track01@44100s),
# the script automatically takes the given values from the name.
# If the headerless stream has the format NAME@FREQ, func_header_XMA.bms
# will detect the channel count.
# Remember to try parsing the stream to XMA1 before adding a header.
#
# (c) 2012-03-26 by AlphaTwentyThree of XeNTaX 

include "func_header_XMA.bms"
include "func_str2num.bms"

set FREQ_DEFAULT 44100
set CH_DEFAULT 2
set OFFSET 0x0
callfunction getfreqch 1
if FREQ == 0
	set FREQ FREQ_DEFAULT
	print "No frequency given.\nDefault frequency is %FREQ%Hz."
endif
if CH == 0
	set CH CH_DEFAULT
	print "Number of channels could not be determined.\nDefault is %CH% channels."
endif

get SIZE asize
math SIZE -= OFFSET
callfunction XMA 1
set NAME NAME_BASE # see function getfreq
string NAME += ".xma"
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE


startfunction getfreqch # internal use only
	get NAME basename # search for freq and ch in file name via "@" identifier
	strlen NAMEL NAME
	set EXISTS 0
	for i = 0 < NAMEL # write name to memory
		getVarChr T NAME i
		if T == 0x40
			set EXISTS 1
		endif
		putVarChr MEMORY_FILE i T
	next i
	if EXISTS == 1 # freq info given
		getCT NAME_BASE string 0x40 MEMORY_FILE
		strlen NAMEBL NAME_BASE
		math NAMEBL += 1 # start of stream info in name
		set LENGTH NAMEL
		math LENGTH -= NAMEBL # length of string behind @
		set CH_OFF NAMEL
		math CH_OFF -= 1
		getVarChr CHANNELS NAME CH_OFF
		if CHANNELS < 0x40 # no channel count given -> determine channels
			callfunction getCH 1
		else # use channel count from file name
			math LENGTH -= 1
			if CHANNELS == 0x6d
				set CH 1
			elif CHANNELS == 0x73
				set CH 2
			endif
		endif
		goto NAMEBL MEMORY_FILE
		getDstring NUM LENGTH MEMORY_FILE # get freq as string
		callfunction str2num 1 # convert to integer
		set FREQ NUM
	else
		set FREQ 0
		callfunction getCH 1
		get NAME_BASE basename
	endif
endfunction
func_header_XMA.bms
Needed parameters are FREQ, OFFSET and SIZE. The channel variable CH is optional. If not given, the script will try to determine the nuber of channels automatically. However if no channel count can be determined, the default channel count is taken (important because you have to set it manually).
needs my variable test: viewtopic.php?f=13&p=69586#p69586

Code: Select all

# revision 2012-04-03

include "func_checkVAR.bms"
startfunction XMA
	endian little
	if CH == ""
		callfunction getCH
	endif
	callfunction checkVAR 1
		set PRESIZE RIFFSIZE # pre-alloc
		math PRESIZE += 0x38
		log MEMORY_FILE PRESIZE 0
		log MEMORY_FILE 0 0
	set MEMORY_FILE binary "\x52\x49\x46\x46\xb8\x59\xa7\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x20\x00\x00\x00\x65\x01\x10\x00\xd6\x10\x00\x00\x01\x00\x00\x03\xe3\x9a\x00\x00\x80\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x02\x00\x64\x61\x74\x61\x00\x58\xa7\x00"
	set RIFFSIZE SIZE
	math RIFFSIZE += 0x34
	putVarChr MEMORY_FILE 0x04 RIFFSIZE long
	putVarChr MEMORY_FILE 0x24 FREQ long
	putVarChr MEMORY_FILE 0x31 CH byte
	putVarChr MEMORY_FILE 0x38 SIZE long
	append
	log MEMORY_FILE OFFSET SIZE
	append
endfunction

startfunction getCH
	set CHOFF OFFSET
	math CHOFF += 7
	goto CHOFF
	get IDENT byte
	if IDENT == 1
		set CH 2
	elif IDENT == 3
		set CH 1
	elif IDENT == 0 # from multichannel stream
		set CH 2
	else
		set CH ""
	endif
endfunction
Last edited by AlphaTwentyThree on Tue Apr 03, 2012 5:10 pm, edited 13 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 ;)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: My quickBMS scripts

Post by OrangeC » Sun Jan 02, 2011 12:33 am

Thanks! :)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: My quickBMS scripts

Post by OrangeC » Tue Jan 04, 2011 11:24 pm

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

Barnaby
advanced
Posts: 47
Joined: Mon Dec 14, 2009 5:41 pm

Re: My quickBMS scripts

Post by Barnaby » Wed Jan 05, 2011 9:56 pm

Can you mod your EA XMA script for this please?

http://flameupload.com/files/0LJDWAQW/A ... _Track.xxx

Thx in advance!

Chronic
beginner
Posts: 20
Joined: Thu Jan 06, 2011 12:36 pm
Been thanked: 2 times

Re: My quickBMS scripts

Post by Chronic » Thu Jan 06, 2011 12:48 pm

I've heard someone asked for something that would make Call Of Duty:Black Ops(PC) .wav's valid, so I made something (apologies if it has already been made). The tool can extract and automatically fix wavs coming from COD:BO .iwd files, just drag them in the .exe and you will get in about 4-5 minutes valid .wavs (readme is included with the download).
Download link: http://gljivolog.com/data/releases/bo_rip_beta.rar

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: My quickBMS scripts

Post by OrangeC » Tue Jan 18, 2011 10:28 pm

Hey alpha does the search string for your general script have to be strictly 8 bytes? because when i try to do lower like 6 or 4 it just outputs the same archive from the first search string offset.

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: My quickBMS scripts

Post by AlphaTwentyThree » Wed Jan 26, 2011 4:52 pm

OrangeC wrote:Hey alpha does the search string for your general script have to be strictly 8 bytes? because when i try to do lower like 6 or 4 it just outputs the same archive from the first search string offset.
You need to adjust the += value down there to the length of your search string.
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 ;)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: My quickBMS scripts

Post by OrangeC » Wed Jan 26, 2011 8:07 pm

okay thanks! :)

TEOL
ultra-n00b
Posts: 6
Joined: Thu Jan 27, 2011 7:22 pm

Re: My quickBMS scripts

Post by TEOL » Thu Jan 27, 2011 7:32 pm

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

User avatar
Mr.Mouse
Site Admin
Posts: 4041
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 412 times
Been thanked: 561 times
Contact:

Re: My quickBMS scripts

Post by Mr.Mouse » Sun Jan 30, 2011 5:41 pm

You can use QuickBMS scripts also in MultiEx Commander now that acts as a GUI.

http://www.youtube.com/watch?v=9afcbJxNvcE

TEOL
ultra-n00b
Posts: 6
Joined: Thu Jan 27, 2011 7:22 pm

Re: My quickBMS scripts

Post by TEOL » Mon Jan 31, 2011 2:47 pm

Mr.Mouse wrote:You can use QuickBMS scripts also in MultiEx Commander now that acts as a GUI.

http://www.youtube.com/watch?v=9afcbJxNvcE
What has this got to do with my Smackdown Vs Raw 2011 PS3 music.pck? It's paid software too. I want a tool that can snoop my file for free.

GenericRipper
advanced
Posts: 43
Joined: Sun Mar 21, 2010 5:41 pm
Has thanked: 40 times
Been thanked: 4 times

Re: My quickBMS scripts

Post by GenericRipper » Mon Jan 31, 2011 3:49 pm

Why not run this free script
AlphaTwentyThree wrote:

Code: Select all

get BNAME basename
string BNAME += "_"
set OFFSET 0
set SEARCH OFFSET
math SEARCH += 4
set QUIT 0
for i = 1
	goto SEARCH
	FindLoc SIZE string "RIFX" 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 += 4
	else
		cleanexit
	endif
next i
with a help of a free program named QuickBMS and convert resulting *.rifx files using a free program named WW2OGG and this batch file?
for %%a in (*.RIFX) do ww2ogg.exe "%%a"

User avatar
Mr.Mouse
Site Admin
Posts: 4041
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 412 times
Been thanked: 561 times
Contact:

Re: My quickBMS scripts

Post by Mr.Mouse » Mon Jan 31, 2011 5:38 pm

TEOL wrote:
Mr.Mouse wrote:You can use QuickBMS scripts also in MultiEx Commander now that acts as a GUI.

http://www.youtube.com/watch?v=9afcbJxNvcE
What has this got to do with my Smackdown Vs Raw 2011 PS3 music.pck? It's paid software too. I want a tool that can snoop my file for free.
For your information, MultiEx Commander used to be freely downloadable since 1997, so about 14 years. The only reason users are asked for a small donation is to ensure the continuation of the free information at XeNTaX.

Second, "I want" is a disrespectful attitude towards those people that work in their freetime to support new formats, such as the one you aim for. And they do this for free. And guys like you probably have no sense of the cost of things. You probably expect everything to be free, heck perhaps even demand stuff to be free.

Like I said in my post above, you can now *also* use QuickBMS scripts in MultiEx Commander, if you feel like having a GUI to preview files you extract, and extract only those files you wish to extract. The free - original command line- option is described by AlphaTwentyThree.

User avatar
cozy
beginner
Posts: 39
Joined: Mon Dec 07, 2009 10:18 pm
Been thanked: 17 times

Re: My quickBMS scripts

Post by cozy » Mon Jan 31, 2011 10:58 pm

Thanks for the scrips they are good,but is there any chance of a .aa3 to .at3(+)

cheers cozy

Post Reply