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

All times are UTC + 1 hour




Post new topic Reply to topic  [ 466 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 32  Next
Author Message
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Mar 19, 2012 2:50 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times

Just did a major update with the PCM and XMA header. Now with correct use of functions!

You can make the ads go away by registering


_________________
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: Tue Mar 20, 2012 2:36 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
NDS SPK extractor
Extracts the *.spk sound packs from NDS games. These usually contain *.swav files. Don't forget to include the func_getTYPE.bms.

Code:
include "func_getTYPE.bms"
idstring "SMPK"
get FILES long
goto 0x10
for i = 1 <= FILES
   get TYPE long
   get OFFSET long
   get SIZE long
   get ZSIZE long
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction getTYPE 1
   get NAME basename
   string NAME += "_"
   string NAME += i
   string NAME += EXT
   log NAME 0 SIZE MEMORY_FILE
next i

_________________
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: Tue Mar 20, 2012 3:09 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Bratz DS pkg extractor
Extractor for three of the Bratz games for Nintendo DS.

Code:
# extracts the *.pkg file from the following games:
# - Bratz: 4 Real (DS)
# - Bratz: Forever Diamondz (DS)
# - Bratz: Girlz Really Rock (DS)
# (c) 2012-03-20 by AlphaTwentyThree of XeNTaX

idstring "pkg"
comtype gzip
goto 8
get FILES long
goto 0x30
for i = 1 <= FILES
   getDstring NAME 0x20
   get FNUMB short
   get COMP short
   get ZSIZE long
   get SIZE long
   get OFFSET long
   get ZERO long
   if COMP == 0
      log NAME OFFSET SIZE
   elif COMP == 1
      clog NAME OFFSET SIZE ZSIZE
   endif
next i

_________________
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: Tue Mar 20, 2012 3:41 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
BigFile.bin Extractor for Bratz DS
Thanks to comtype_scan2.bms, I got the compression type easily! =)

Code:
# extracts the BigFile.bin from the following games:
# - Bratz Kidz: Party (DS)
# - Bratz Kidz: Slumber Party (DS)
# - Bratz Ponyz (DS)
#
# (c) 2012-03-20 by AlphaTwentyThree of XeNTaX

comtype PUYO_LZ01
get FILES long
for i = 1 <= FILES
   get OFFSET threebyte
   get COMP byte
   get ZSIZE long
   get SIZE long
   savepos MYOFF
   math MYOFF += 0x20
   get NAME string
   goto MYOFF
   get ZERO long
   get UNK long
   if COMP == 1
      clog NAME OFFSET SIZE ZSIZE
   else
      log NAME OFFSET SIZE
   endif
next i

_________________
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: Sat Mar 24, 2012 1:54 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Yesterday RESOURCE extractor
Extracts the files from the new Pendulo Studios game. Make sure you have the latest func_getTYPE.bms (extended and corrected again)!

Code:
# extract RESOURCE files from the game 'Yesterday' (Pendulo Studios)
#
# (c) 2012-03-24 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
set EXT ""
get FILES long
get SUFFIX extension
set TEST ""
getVarChr T SUFFIX 0
putVarChr TEST 0 T
getVarChr T SUFFIX 1
putVarChr TEST 1 T
if TEST == "S0"
   callfunction type1 1
else
   callfunction type2 1
endif

startfunction type1
   for i = 1 <= FILES
      get OFFSET long
      get SIZE long
      get ZERO long
      get FILETYPE byte
      if SIZE != 0x2c # only header, i.e. empty stream
         log MEMORY_FILE 0 0
         log MEMORY_FILE OFFSET SIZE
         get NAME basename
         string NAME += "."
         get SUFFIX extension
         string NAME += SUFFIX
         string NAME += "_"
         string NAME += i
         callfunction getTYPE 1
         string NAME += EXT
         log NAME 0 SIZE MEMORY_FILE
      endif
   next i
endfunction

startfunction type2 # all but sounds
   set SIZEOFF FILES
   math SIZEOFF += 4
   math FILES /= 4
   for i = 1 <= FILES
      get OFFSET long
      savepos MYOFF
      goto SIZEOFF
      get SIZE long
      savepos SIZEOFF
      if SIZE != 0
         log MEMORY_FILE 0 0
         log MEMORY_FILE OFFSET SIZE
         get NAME basename
         string NAME += "."
         get SUFFIX extension
         string NAME += SUFFIX
         string NAME += "_"
         string NAME += i
         callfunction getTYPE 1
         string NAME += EXT
         log NAME 0 SIZE MEMORY_FILE
      endif
      goto MYOFF
   next i
endfunction

_________________
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 Mar 25, 2012 4:47 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Just updated func_getTYPE and my Armored Core V script.

_________________
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 Mar 26, 2012 8:26 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Had to correct the header_adder_XMA.bms due to a wrong if case when reading the channel count from the file name. Works now. :)

_________________
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 Apr 01, 2012 7:39 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
POD5 extractor
I guess there are other games with this format.
Code:
# extracts POD5 archives
#
# supported games:
# Kinect Star Wars (Xbox 360)
# Country Dance All-Stars (Xbox 360)
#
# (c) 2012-04-04 by AlphaTwentyThreee of XeNTaX

idstring "POD5"
goto 0x58
get FILES long
goto 0x108
get INFO long
set NAMEOFF FILES
math NAMEOFF *= 0x1c
math NAMEOFF += INFO
goto INFO
for i = 1 <= FILES
   get NAMEPOS long
   math NAMEPOS += NAMEOFF
   get SIZE long
   get OFFSET long
   get ZSIZE long
   get ZERO long
   get UNK long
   get UNK long
   savepos MYOFF
   goto NAMEPOS
   get NAME string
   if SIZE == ZSIZE
      log NAME OFFSET SIZE
   else
      clog NAME OFFSET SIZE ZSIZE
   endif
   goto MYOFF
next i

_________________
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 Apr 04, 2012 5:25 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Apr 01, 2012 11:18 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Warriors Orochi 3 (Xbox 360) - [g1l] & [idx/bin]

The BGMLink.g1l contains the music (6ch XMA2).
Code:
# extracts the BGMLink.g1l from Warriors Orochi 3 (Xbox 360)
#
# (c) 2012-04-01 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
idstring "G1L_0000"
endian big
get FILESIZE long
get DATASTART long
get UNK long
get FILES long
for i = 1 <= FILES
   get OFFSET long
   if i != FILES
      savepos MYOFF
      get SIZE long
      goto MYOFF
   else
      get SIZE asize
   endif
   math SIZE -= OFFSET
   log MEMORY_FILE SIZE 0 # pre-alloc
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction getTYPE 1
   get NAME basename
   string NAME += "_"
   string NAME += i
   string NAME += EXT
   endian little
   log NAME 0 SIZE MEMORY_FILE
   endian big
next i


The bin files contain all other game files including the sounds as XMA (large packs at the end of the archive).
Code:
# Extracts the contents of the bin/idx pairs from Warriors Orochi 3 (Xbox 360)
#
# (c) 2012-04-02 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
open FDDE IDX 0
open FDDE BIN 1
endian big
set FN 1
get ENTRIES asize 0
math ENTRIES /= 0x20
for i = 1 <= ENTRIES
   get ZERO long 0
   get OFFSET long 0
   get ZERO long 0
   get UNK long 0
   get ZERO long 0
   get SIZE long 0
   get ZERO long 0
   get UNK long 0
   if SIZE > 1
      log MEMORY_FILE SIZE 0 # pre-alloc
      log MEMORY_FILE 0 0
      log MEMORY_FILE OFFSET SIZE 1
      endian little
      callfunction getTYPE 1
      endian big
      get NAME basename 0
      string NAME += "_"
      string NAME += FN
      math FN += 1
      string NAME += EXT
      log NAME 0 SIZE MEMORY_FILE
   endif
next i

_________________
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 Tue Apr 03, 2012 5:06 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Apr 01, 2012 11:36 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2402
Has thanked: 56 times
Have thanks: 1137 times
AlphaTwentyThree wrote:
Warriors Orochi 3 (Xbox 360) - [g1l] & [idx/bin]

The BGMLink.g1l contains the music (6ch XMA2).
Code:
# extracts the BGMLink.g1l from Warriors Orochi 3 (Xbox 360)
#
# (c) 2012-04-01 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
idstring "G1L_0000"
endian big
get FILESIZE long
get DATASTART long
get UNK long
get FILES long
for i = 1 <= FILES
   get OFFSET long
   if i != FILES
      savepos MYOFF
      get SIZE long
      goto MYOFF
   else
      get SIZE asize
   endif
   math SIZE -= OFFSET
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction getTYPE 1
   get NAME basename
   string NAME += "_"
   string NAME += i
   string NAME += EXT
   endian little
   log NAME 0 SIZE MEMORY_FILE
   endian big
next i


The bin files contain all other game files including the sounds as XMA (large packs at the end of the archive).
Code:
# Extracts the contents of the bin/idx pairs from Warriors Orochi 3 (Xbox 360)
#
# (c) 2012-04-02 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
open FDDE IDX 0
open FDDE BIN 1
endian big
set FN 1
get ENTRIES asize 0
math ENTRIES /= 0x20
for i = 1 <= ENTRIES
   get ZERO long 0
   get OFFSET long 0
   get ZERO long 0
   get UNK long 0
   get ZERO long 0
   get SIZE long 0
   get ZERO long 0
   get UNK long 0
   if SIZE > 1
      log MEMORY_FILE 0 0
      log MEMORY_FILE SIZE 0 # pre-alloc
      log MEMORY_FILE OFFSET SIZE 1
      endian little
      callfunction getTYPE 1
      endian big
      get NAME basename 0
      string NAME += "_"
      string NAME += FN
      math FN += 1
      string NAME += EXT
      log NAME 0 SIZE MEMORY_FILE
   endif
next i



if you decompress the xex file you should be able to spot the file table without much trouble.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Apr 03, 2012 5: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
I've decompressed some xex files and I didn't find a list of files inside archives. Can you explain further please?

_________________
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: Tue Apr 03, 2012 8:09 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
convert XMA cue markers to WAVE cue marers
Wrote this one when I encountered XMA2 files with markers (Kinect Star Wars). The script takes the xma cue file, reads available information into an array and constructs a new cue file from scratch, including the ltxt section per marker. Conversion from big to little endian is also implemented.
Find the func_writename.bms in the post below.
Code:
# convert xma cue markers to wave cue markers
#
# (c) 2012-04-03 by AlphaTwentyThree of XeNTaX

include "func_writename.bms"
endian big
idstring "cue "
get CUESIZE long
if CUESIZE >= 0x100000 # work-around
   endian little
endif
get MARKERS long
for i = 1 <= MARKERS
   get MID long # marker ID
   get MSAMP1 long # always same as MSAMP2 (?)
   idstring "data"
   get ZERO long
   get ZERO long
   get MSAMP2 long
   putArray 0 MID MSAMP1 long
   putArray 1 MID MSAMP2 long
   putArray 2 MID "" string # reset
next i
idstring "LIST"
get LISTSIZE long
if LISTSIZE == 0 # lables are optional
   callfunction wavcue 1
   cleanexit
endif
idstring "adtl" # table, empty in XMA markers
get CSIZE asize
math CSIZE -= 1 # last byte is 0
do
   get IDENT long
   if IDENT == 0x6c6162
      savepos MYOFF
      math MYOFF += 1
      goto MYOFF
   endif
   get LSIZE long
   get MID long
   set MNAMEL LSIZE
   math MNAMEL -= 4
   getDstring MNAME MNAMEL
   putArray 2 MID MNAME string
   savepos TEST
while TEST < CSIZE
callfunction wavcue 1

startfunction wavcue
   endian little
   putVarChr MEMORY_FILE 0 0x20657563 long # "cue "
   set CUESIZE MARKERS
   math CUESIZE *= 0x18
   math CUESIZE += 4
   putVarChr MEMORY_FILE 4 CUESIZE long
   putVarChr MEMORY_FILE 8 MARKERS long
   set WPOS CUESIZE
   math WPOS += 8
   putVarChr MEMORY_FILE WPOS 0x5453494c long # "LIST"
   math WPOS += 4
   set LISTSZ WPOS # position of LIST size
   math WPOS += 4
   putVarChr MEMORY_FILE WPOS 0x6c746461 long # "adtl"
   math WPOS += 4
   set LTXTPOS WPOS
   set WPOS 0xc
   for i = 1 <= MARKERS # "cue " section
      putVarChr MEMORY_FILE WPOS i long # MID
      math WPOS += 4
      getArray MSAMP1 0 i
      putVarChr MEMORY_FILE WPOS MSAMP1 long
      math WPOS += 4
      putVarChr MEMORY_FILE WPOS 0x61746164 long # "data"
      math WPOS += 0xc
      getArray MSAMP2 1 i
      putVarChr MEMORY_FILE WPOS MSAMP2 long
      math WPOS += 4
      set NXT i
      math NXT -= 1
      math NXT *= 0x1c
      math NXT += LTXTPOS
      putVarChr MEMORY_FILE NXT 0x7478746c long # "ltxt"
      math NXT += 4
      putVarChr MEMORY_FILE NXT 0x14 long
      math NXT += 4
      putVarChr MEMORY_FILE NXT i long
      math NXT += 8
      putVarChr MEMORY_FILE NXT 0x206e6772 long # "rgn "
   next i
   set WPOS NXT
   math WPOS += 0xc
   for i = 1 <= MARKERS
      getArray LABEL 2 i
      if LABEL != ""
         putVarChr MEMORY_FILE WPOS 0x6c62616c long # "labl"
         math WPOS += 4
         strlen LABSIZE LABEL
         math LABSIZE += 5
         putVarChr MEMORY_FILE WPOS LABSIZE long
         math WPOS += 4
         putVarChr MEMORY_FILE WPOS i long # MID
         math WPOS += 4
         set STRPOS WPOS
         set NAME LABEL
         callfunction writename 1
         get WPOS asize MEMORY_FILE
         putVarChr MEMORY_FILE WPOS 0 byte
         math WPOS += 1
      endif
   next i
   get SIZE asize MEMORY_FILE
   set PUTLSIZE SIZE
   math PUTLSIZE -= LISTSZ
   math PUTLSIZE -= 4
   putVarChr MEMORY_FILE LISTSZ PUTLSIZE long
   get NAME basename
   string NAME += ".wcue"
   log NAME 0 SIZE MEMORY_FILE
endfunction

_________________
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 Tue Apr 03, 2012 8:38 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Apr 03, 2012 8:10 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
func_writename.bms
Write a string to memory. Isn't implemented in QuickBMS but needed sometimes.

Code:
# writes a given string NAME to offset STRPOS of the MEMORY_FILE
#
# (c) 2012-04-03 by AlphaTwentyThree of XeNTaX

startfunction writename
   strlen NAMESZ NAME
   for z = 0 < NAMESZ
      set TMP STRPOS
      math TMP += z
      getvarchr CHR NAME z
      putvarchr MEMORY_FILE TMP CHR byte
   next z
endfunction

_________________
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: Wed Apr 04, 2012 7: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
*.fpk "FKP" extractor
Found one game so far that uses this format but I guess there are others.

Code:
# extracts the GameData.fpk from various XBLA games
#
# supported games:
# - Flock!
#
# (c) 2012-04-04 by AlphaTwentyThree of XeNTaX

idstring "FKP"
get IDENT byte
goto 8
get FILES long
get UNK long
for i = 1 <= FILES
   savepos MYOFF
   getCT NAME string 0xcc
   math MYOFF += 0x30
   goto MYOFF
   get UNK long
   get UNK long
   get SIZE long
   get OFFSET long
   log NAME OFFSET SIZE
next i

_________________
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: Wed Apr 04, 2012 8:43 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 593 times
Important update on the func_getTYPE.bms! Update your files!


_________________
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 ... 12, 13, 14, 15, 16, 17, 18 ... 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