XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Feb 20, 2017 12:45 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 465 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25, 26 ... 31  Next
Author Message
 Post subject: Re: My quickBMS scripts
PostPosted: Mon Sep 17, 2012 2:14 pm 
Offline
double-veteran
double-veteran

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

Just made a really extensive update for both the EA ast extractor and func_getTYPE.bms (faster and more sophisticated)! Extreme enhancements FTW! ;)

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: Fri Sep 21, 2012 5:02 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
The script for the Unity3D engine was somewhat faulty, so I made some major updates: viewtopic.php?f=13&t=4450&p=77959#p77959
I'm not sure about the internal "type", this could also be some folder because e.g. type 49 contains various types of files. Inside the script you find a list of types I've encountered so far and as I'm no specialist in this and don't recognize certain types, it would be cool if you contribute here and tell me some of the types I haven't adjusted the extraction process yet. :)

_________________
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: Fri Sep 21, 2012 8:54 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4003
Location: Dungeons of Doom
Has thanked: 403 times
Have thanks: 537 times
Also put a spot light on Facebook http://www.facebook.com/permalink.php?s ... 8469022795
;-)

_________________
Please like our Facebook page!


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sat Sep 22, 2012 4:06 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Mr.Mouse wrote:

Yay! :)

_________________
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 Sep 25, 2012 10:38 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Raw Activision BAF extractor

This script will just append the data to the header info at the start of the baf archive and write it to disk for post-processing. This is practical if the audio format can't e played yet but you want to extract the baf files nevertheless, e.g. Sony ADPCM variant from 007: Blood Stone (PC).

Code:
# raw Activision BAF extractor
# this script only extracts the raw data from baf files (header, cue markers, stream data)
# to be used for later post-processing of the contained audio files (saved as *.wavl)
# (c) 2012-09-25 by AlphaTwentyThree of XeNTaX

idstring "BANK"
get SINFO long
if SINFO != 0x34
   endian big
   reverselong SINFO
endif
get UNK long
get FILES long
goto SINFO
savepos HOFF
for i = 1 <= FILES
   idstring "WAVE"
   get HSIZE long
   get UNK0 long
   getDstring NAME 0x20
   get SOFF long # stream start
   math SOFF -= 8
   get SSIZE long
   set COFF HOFF
   math COFF += HSIZE
   goto COFF
   getDstring CID 4
   if CID == "CUE "
      get CSIZE long
   else
      set CSIZE 0
   endif
   set SIZE HSIZE
   math SIZE += CSIZE
   math SIZE += SSIZE
   putVarChr MEMORY_FILE SIZE 0
   log MEMORY_FILE 0 0
   goto HOFF
   getDstring HDATA HSIZE
   putDstring HDATA HSIZE MEMORY_FILE
   if CSIZE != 0
      goto COFF
      getDstring CDATA CSIZE
      putDstring CDATA CSIZE MEMORY_FILE
   else
      set CSIZE 0
   endif
   goto SOFF
   getDstring SDATA SSIZE
   putDstring SDATA SSIZE MEMORY_FILE
   string NAME += ".wavel"
   log NAME 0 SIZE MEMORY_FILE
   math HSIZE += CSIZE
   math HOFF += HSIZE
   goto HOFF
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 Sep 25, 2012 10:46 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Sep 25, 2012 8:56 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 13, 2004 1:55 am
Posts: 698
Location: The wiki.
Has thanked: 106 times
Have thanks: 122 times
AlphaTwentyThree wrote:
Code:
# (c) 2021-09-25 by AlphaTwentyThree of XeNTaX

Time traveling now, are we? ;)

_________________
Welcome to Xentax!

Rules | Requests | Wiki

If you run across a post that breaks the rules, please PM Craptain, Mr.Mouse, or myself - we will handle it from there.


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Sep 25, 2012 10:46 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Dinoguy1000 wrote:
AlphaTwentyThree wrote:
Code:
# (c) 2021-09-25 by AlphaTwentyThree of XeNTaX

Time traveling now, are we? ;)

See, THAT'S how advanced my scripts are! ;)

_________________
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 Sep 30, 2012 10:34 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Just added ogm video detection to my Unity3D engine 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: Tue Oct 02, 2012 12:03 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Turok: Evolution *.tre extractor

This doesn't look so special, but believe me, it was really some hazzle to figure out the format because the files in the TOC are sorted by file crc and din't have any names. I ran many many tests - and finally found a file with the file names (sorted by offset, so the new sortarray function came it pretty handy ;) )
This is a script I'm really really proud of! :)
(Just for your info: The old script from some years only extracted the files without names.)

Code:
# extracts the contents of the big STREE0.TRE archive from Turok: Evolution (PS2)
# note: CORRECT NAMES!!!
# (c) 2012-10-02 by AlphaTwentyThree of XeNTaX

get FILES long
for i = 0 < FILES
   get OFFSET long
   get SIZE long
   get DATA_CRC long
   get NAME_CRC long
   putArray 0 i OFFSET
   putArray 1 i SIZE
next i
print "sorting array"
sortarray 0 1
getArray NAMEOFF 0 2
goto NAMEOFF
for i = 0 < FILES
   getCT NAME string 0x0d
   get DUMMY byte
   getArray OFFSET 0 i
   getArray SIZE 1 i
   log NAME OFFSET SIZE
next i

Just for completeness' sake, here's the version for archives where no names are given. Note that sorting is still needed. Needs the newest func_getTYPE.bms (see link list)
Code:
# extracts *.TRE archives from Turok: Evolution (PS2)
# note: for the main STREE.TRE use my other script!
# (c) 2012-10-02 by AlphaTwentyThree of XeNTaX

include "func_getTYPE.bms"
get FILES long
for i = 0 < FILES
   get OFFSET long
   get SIZE long
   get DATA_CRC long
   get NAME_CRC long
   putArray 0 i OFFSET
   putArray 1 i SIZE
   putarray 2 i NAME_CRC
next i
print "sorting array"
sortarray 0 1
get BNAME basename
string BNAME += "_"
for i = 0 < FILES
   getArray OFFSET 0 i
   getArray SIZE 1 i
   getArray CRC 2 i
   putVarChr MEMORY_FILE SIZE 0
   log MEMORY_FILE 0 0
   append
   log MEMORY_FILE OFFSET SIZE
   append
   string CRC p= "_0x%08x" CRC
   set NAME BNAME
   string NAME += i
   string NAME += CRC
   callfunction getTYPE 1
   if EXT != ""
      string NAME += EXT
   endif
   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 ;)


Last edited by AlphaTwentyThree on Tue Oct 02, 2012 1:25 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Oct 02, 2012 12:58 am 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
PS2 stereo vag (AAAp) to ss2 converter

I don't know the actual extension of the files (extracted, no names given), I guess it's also *.vag, only stereo. Could easily be included in vgmstream if someone knows the original extension.
Don't forget to put the func_header.bms (viewtopic.php?f=13&p=44717#p44717) in the same directory - as always. ;)

Code:
# stereo vag to SS2 converter for PS2 games
# (c) 2012-10-02 by AlphaTwentyThree of XeNTaX

include "func_header_SS2.bms"
idstring "AAAp"
get INTERLEAVE short
get CH short
goto 0x1a
get FREQ short
reverseshort FREQ
set OFFSET 0x68
get SIZE asize
math SIZE -= OFFSET
set NAME ""
callfunction SS2 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 ;)


Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Sun Oct 07, 2012 7:30 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Improvements never stop: Updated the Unit3D extractor by mp3 detection and included an archive variant sometimes used by the big resources.assets. Just encountered in Frederic: Resurrection of Music (Mac, 2012)
Find the updated script here: viewtopic.php?f=13&t=4450&p=77959#p77959 =)

_________________
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 Oct 08, 2012 7:47 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Electronic Arts *.big extractor

I know there are many different archives in use by EA - this is one of them at least (identifier "BE"). For the PC version, just delete the "endian big" - I guess. ;)
Nice example for the use of the array, which comes in quite handy here. Thanks Luigi for the implementation of the chunklzx unpack function. :)

Code:
# extracts EA big archives with "EB" identifier
# tested with NHL 13 (X360)
# (c) 2012-10-08 by AlphaTwentyThree of XeNTaX

comtype xmemdecompress
idstring \x45\x42\x00\x03
endian big
goto 4
get FILES long
get UNK long # some size
get OFF_NAMES long # plus random bias of zeros
get SIZE_NAMES long
get NAMEL_FILE byte
get NAMEL_FOLDER byte
get ZERO byte
get FOLDERS byte
set OFF_FOLDERS FILES
math OFF_FOLDERS *= NAMEL_FILE
math OFF_FOLDERS += OFF_NAMES
math OFF_FOLDERS x= 0x10 # round to next 0x10 bytes
math NAMEL_FILE -= 2 # short for folder number

goto 0x30
for i = 1 <= FILES
   get OFFSET long
   math OFFSET *= 0x10
   get ZERO long
   get SIZE long
   get HASH long
   putArray 0 i OFFSET
   putArray 1 i SIZE
next i
goto OFF_NAMES
for i = 1 <= FILES
   get FOLDER_NUMBER short
   getDstring NAME NAMEL_FILE
   savepos MYOFF
   set OFF_FOLDERNAME FOLDER_NUMBER
   math OFF_FOLDERNAME *= NAMEL_FOLDER
   math OFF_FOLDERNAME += OFF_FOLDERS
   goto OFF_FOLDERNAME
   getDstring FOLDER NAMEL_FOLDER
   set FNAME FOLDER
   string FNAME += "/"
   string FNAME += NAME
   getArray OFFSET 0 i
   getArray SIZE 1 i
   goto OFFSET
   getDstring COMP 8
   if COMP == "chunklzx"
      callfunction unpack 1
      log FNAME 0 SIZE MEMORY_FILE
   else
      log FNAME OFFSET SIZE
   endif
   goto MYOFF
next i

startfunction unpack # (c) Luigi Auriemma
    get DUMMY long
    get FULLSIZE long
    get SIZE long
    get CHUNKS long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    log MEMORY_FILE 0 0
    append
    savepos OFFSET
    for j = 0 < CHUNKS
        math OFFSET x= 0x8
        for # very lame, made on the fly
            math T = OFFSET
            math T %= 0x10
            if T == 8
                break
            endif
            math OFFSET += 8
        next
        goto OFFSET
        get ZSIZE long
        get DUMMY long
        savepos OFFSET
        clog MEMORY_FILE OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
    next j
    append
    get MYSIZE asize MEMORY_FILE
    if MYSIZE != FULLSIZE
        print "Alert: MEMORY_FILE %MYSIZE% != %FULLSIZE%"
    endif
   set SIZE FULLSIZE
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 Oct 09, 2012 10:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: My quickBMS scripts
PostPosted: Tue Oct 09, 2012 3:05 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
The Amazing Spider-Man *.pkz decompressor

Decompresses the pkz archives from the game and writes the header and decompressed data to disk. I can't make any sense of the given offsets in the header, but if anyone wants to take a look, I can provide a sample.
Nothing special here, so again, it's just another example for the QuickBMS-curious (comments provided). ;)

Code:
# decompresses the *.pkz files from The Amazing Spider-Man (PC)
# no extraction of individual files at the moment (TOC offsets don't fit)
# (c) 2012-10-09 by AlphaTwentyThree of XeNTaX

comtype zlib_noerror
get IDENT long
if IDENT == 0xb0b1bEbA
   endian big
elif IDENT == 0xbabeb1b0
else
   cleanexit
endif
get DATA_OFF long              # start of compressed data
get NAME basename
string NAME += ".header"
log NAME 0 DATA_OFF            # write header to disk for later research
get BLOCKSIZE long             # length of one zlib block
get LOOPS asize                # calculate the number of loops
math LOOPS -= DATA_OFF
math LOOPS /= BLOCKSIZE
# memory pre-allocation
get SIZE asize
math SIZE -= DATA_OFF
math SIZE *= 10
putVarChr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0
set OFFSET DATA_OFF  # initialize first offset
set SIZE BLOCKSIZE
math SIZE *= 10      # set decompressed size to some default
append
for i = 1 <= LOOPS
   clog MEMORY_FILE OFFSET BLOCKSIZE SIZE # decompress block to memory
   math OFFSET += BLOCKSIZE               # jump to next block
next i
append
get NAME basename
string NAME += ".decomp"
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE

_________________
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 Oct 09, 2012 3:53 pm 
Offline
double-veteran
double-veteran

Joined: Mon Aug 24, 2009 10:55 pm
Posts: 984
Has thanked: 74 times
Have thanks: 585 times
Found a quite stupid mistake in my generic splitter which I won't explain any further. ;)
Be sure to grab the updated script here: viewtopic.php?f=13&t=4450&p=45460#p45460!

_________________
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 Oct 09, 2012 10:05 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 13, 2004 1:55 am
Posts: 698
Location: The wiki.
Has thanked: 106 times
Have thanks: 122 times
AlphaTwentyThree wrote:
Code:
set BIAS OFF_FOLDERS
math BIAS %= 0x10
if BIAS != 0
   math OFF_FOLDERS /= 0x10
   math OFF_FOLDERS += 1
   math OFF_FOLDERS *= 0x10
endif

I have a feeling that there's some better way to do this (since, according to my understanding, it's basically just a ceil() function with a custom "cutoff"), but my maths isn't strong enough to pick it out (I think bit-shifting would play a role, though... does QuickBMS actually support bit-wise manipulations?). =/


_________________
Welcome to Xentax!

Rules | Requests | Wiki

If you run across a post that breaks the rules, please PM Craptain, Mr.Mouse, or myself - we will handle it from there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 465 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25, 26 ... 31  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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