My QuickBMS scripts [AlphaTwentyThree]

Do you know a tool, link or website for working on a specific game files or to help game research? Let's collect them here!
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

SS2 mono to stereo

format: 2x *.ss2 (PS2 ADPCM), mono
script type: join left and right channel to stereo file
note 1: channels must be given as l/r or L/R at end of base name
note 2: files are played correctly, no re-interleave needed

Code: Select all

# Channel joiner for *.ss2 files
# accepted formats:
# [name]l.ss2/[name]r.ss2
# [name]L.ss2/[name]R.ss2
# note : resulting files are played correctly
#
# (c) 2022-01-05 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get NAME basename
get EXT extension
if EXT != "ss2"
   print "Error: source files are not ss2! Aborting..."
   cleanexit
endif
string NAME -= 1
string L p "%sl.%s" NAME EXT
string R p "%sr.%s" NAME EXT
open FDSE L 0 S
if S == 0
   string L p "%sL.%s" NAME EXT
   string R p "%sR.%s" NAME EXT
   open FDSE L 0
endif
open FDSE R 1
get SIZEL asize 0
get SIZER asize 1
if SIZEL != SIZER
   print "Error: channels have different sizes! Aborting..."
   cleanexit
endif
goto 0x10 0
get CH byte
if CH != 1
   print "Error: source files are not mono! Aborting..."
   cleanexit
endif
goto 0xc 0
get FREQ long
xmath INTERLEAVE  "SIZEL - 0x28"
xmath PSIZE "SIZEL + SIZER - 0x28" # minus one header
xmath SIZE "SIZEL-0x28"

putVarChr MEMORY_FILE PSIZE 0
log MEMORY_FILE 0 0
   set MEMORY_FILE binary "\x53\x53\x68\x64\x18\x00\x00\x00\x10\x00\x00\x00\xb0\x36\x00\x00\x02\x00\x00\x00\xc0\x2f\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x53\x53\x62\x64\x00\xe8\x11\x00"
   append
   log MEMORY_FILE 0x28 SIZE 0
   log MEMORY_FILE 0x28 SIZE 1
   append
   xmath SIZE "2*SIZEL-0x28"
   putVarChr MEMORY_FILE 0x24 SIZE long
   putVarChr MEMORY_FILE 0xc FREQ long
   putVarChr MEMORY_FILE 0x14 INTERLEAVE long
   putVarChr MEMORY_FILE 0x10 2 byte
   get SIZE asize MEMORY_FILE
   string NAME p "%s.ss2" NAME
   log NAME 0 SIZE MEMORY_FILE
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 1:56 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Wii *.bin extractor

Code: Select all

# Wii *.bin extractor (banner.bin/icon.bin etc.)

# (c) 2022-01-07 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

comtype LZ77WII_RAW10
idstring "IMD5"
endian big
get SIZE asize
math SIZE -= 0x28
set OFFSET 0x28
goto 0x24
get TYPE byte
if TYPE == 0x10
   endian little
endif
get ZSIZE long
get NAME basename
putVarChr MEMORY_FILE ZSIZE 0
log MEMORY_FILE 0 0
clog MEMORY_FILE OFFSET SIZE ZSIZE
get TYPE long MEMORY_FILE
if TYPE == 0x2d38aa55
   string NAME += ".u-8"
else
   string NAME += ".decomp"
endif
log NAME 0 ZSIZE MEMORY_FILE
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:08 pm, edited 3 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Humongous Entertainment Inc.
(https://www.mobygames.com/company/humon ... inment-inc)

script type: add wave header
function: add an appropriate header to the files found in (\SOUND)\DIGI\SDAT that Luigi's Humongous script (http://aluigi.altervista.org/bms/humongous.bms) extracts. All files are PCM, 8 bit mono, 11025 Hz. Of course you could also import the raw streams into an audio editor with the according settings but this was is much faster.

Code: Select all

# add a wave pcm header to any data and write to disk
# input variables: SIZE, OFFSET, FREQ, CH, BITS, BLOCKALIGN, CODEC, NAME (or set to "")
# (c) 2012-10-16 by AlphaTwentyThree of XeNTaX

get SIZE asize
set OFFSET 0
set CODEC 1
set FREQ 11025
set CH 1
set BITS 8
set BLOCKALIGN 1
set NAME ""
callfunction PCM 1

startfunction PCM
   endian little
   set PRE SIZE
   math PRE += 0x2c
   putVarChr MEMORY_FILE PRE 0
   log MEMORY_FILE 0 0
   set MEMORY_FILE binary "\x52\x49\x46\x46\x20\xC0\xB1\x00\x57\x41\x56\x45\x66\x6D\x74\x20\x10\x00\x00\x00\x01\x00\x02\x00\x44\xAC\x00\x00\x10\xB1\x02\x00\x04\x00\x10\x00\x64\x61\x74\x61\xFC\xBF\xB1\x00"
   append
   log MEMORY_FILE OFFSET SIZE
   append
   set RIFFSIZE SIZE
   math RIFFSIZE += 36
   set AVGBYTES FREQ
   if CODEC != 2
      math AVGBYTES *= BLOCKALIGN
   endif
   
   putvarchr MEMORY_FILE 0x04 RIFFSIZE long
   putvarchr MEMORY_FILE 0x14 CODEC short          # wFormatTag: Microsoft PCM Format (0x0001)
   putvarchr MEMORY_FILE 0x16 CH short   # wChannels
   putvarchr MEMORY_FILE 0x18 FREQ short   # dwSamplesPerSec
   putvarchr MEMORY_FILE 0x1c AVGBYTES long    # dwAvgBytesPerSec
   putvarchr MEMORY_FILE 0x20 BLOCKALIGN short # wBlockAlign
   putvarchr MEMORY_FILE 0x22 BITS short       # wBitsPerSample
   putvarchr MEMORY_FILE 0x28 SIZE long
   if NAME == ""
      get NAME basename
      if CODEC == 2
         string NAME += ".lwav"
      else
         string NAME += ".wav"
      endif
   endif
   get SIZE asize MEMORY_FILE
   log NAME 0 SIZE MEMORY_FILE
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 1:57 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

EA *.sdh/*.sdt

Code: Select all

# EA *.sdh/*.sdt pairs
# tested on:
# Harry Potter an the the Half-Blood Prince (PS3, Xbox360, PS2)

# (c) 2022-01-18 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

open FDDE sdh 0
open FDDE sdt 1
get BNAME basename 0
getDstring TEST 4 1
if TEST == "SCHl"
   callfunction SNG 1
else
   if TEST == "ADAT"
      set XAS 1
   endif
   callfunction EALayer3 1
endif


startfunction SNG
   get FILES long 0
   for i = 1 <= FILES
      get OFFSET long 0
      get SIZE long 0
      get CRC long 0
      string NAME p "%s_%d_0x%08x.sng" BNAME i CRC
      log NAME OFFSET SIZE 1
   next i
endfunction

startfunction EALayer3
   endian big
   get FILES long 0
   savepos OFF 0
   for i = 1 <= FILES
      goto OFF 0
      get OFFSET long 0
      get D1 long 0
      get CRC long 0
      get D2 long 0
      get D3 long 0
      savepos OFF 0
      if i != FILES
         get SIZE long 0
      else
         get SIZE asize 1
      endif
      math SIZE -= OFFSET
      if XAS == 1
         goto OFFSET 1
         get DUMMY longlong 1
         get HSIZE long 1
         savepos MOFF 1
         xmath MOFF "MOFF + HSIZE"
         goto MOFF 1
         do
            get TEST long 1
         while TEST == 0
         savepos MOFF 1
         math MOFF -= 4
         xmath HSIZE "MOFF - OFFSET"
         math OFFSET += HSIZE
         math SIZE -= HSIZE
      endif
      xmath PSIZE "SIZE + 0x20"
      putVarChr MEMORY_FILE PSIZE 0
      log MEMORY_FILE 0 0
      if XAS != 1
         set MEMORY_FILE binary "\x03\x00\x00\x02\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x05\x04\xAC\x44\x40\x28\xA5\x8E\x00\x78\x65\x00\x66\x6D\x74\x20"
      else
         set MEMORY_FILE binary "\x03\x00\x00\x02\x00\x00\x4C\x1E\x20\x00\x00\x00\x00\x00\x00\x00\x04\x04\xBB\x80\x40\x0E\x45\xA7\x00\x00\x00\x00\x00\x00\x00\x00"
      endif
      putVarChr MEMORY_FILE 0x10 D2 long
      putVarChr MEMORY_FILE 0x14 D3 long
      append
      log MEMORY_FILE OFFSET SIZE 1
      append
      string NAME p "%s_%d_0x%08x.exa.snu" BNAME i CRC
      log NAME 0 PSIZE MEMORY_FILE
   next i
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:07 pm, edited 2 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Lemony Snicket's A Series of Unfortunate Events (GC)

Code: Select all

# Lemony Snicket's A Series of Unfortunate Events (GC) - streams.res

# (c) 2022-01-25 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring "res"
endian big
goto 8
get INFO long
get INFO_SIZE long
get DATA_START long
get UNK long
get HEADERS long
xmath TOC "INFO + HEADERS"
goto TOC
get FILES long
savepos OFF
for i = 0 < FILES
   goto INFO
   get CODEC short
   get CH short
   get FREQ long
   get SIZE long
   get OFFSET long
   math OFFSET += DATA_START
   savepos C1
   xmath C2 "C1 + 0x2e"
   math INFO += 0x70
   putArray 0 i CODEC
   putArray 1 i CH
   putArray 2 i FREQ
   putArray 3 i SIZE
   putArray 4 i OFFSET
   putArray 5 i C1
   putArray 6 i C2
next i

for i = 0 < FILES
   goto OFF
   get NAMEOFF long
   get DUMMY longlong
   savepos OFF
   xmath NAMEOFF "OFF - 0xc + NAMEOFF"
   goto NAMEOFF
   get NAME string
   getArray CH 1 i
   getArray FREQ 2 i
   getArray SIZE 3 i
   getArray OFFSET 4 i
   getArray C1 5 i
   getArray C2 6 i
   callfunction DSP 1
next i

startfunction DSP
   xmath SAMPLES "SIZE - (SIZE/8)"
   xmath PSIZE "SIZE + 0xc0"
   putVarChr MEMORY_FILE SIZE 0
   log MEMORY_FILE 0 0
   putVarChr MEMORY_FILE 0 SAMPLES long
   putVarChr MEMORY_FILE 4 SIZE long
   putVarChr MEMORY_FILE 8 FREQ long
   putVarChr MEMORY_FILE 0x10 CH long
   putVarChr MEMORY_FILE 0x14 SIZE long
   putVarChr MEMORY_FILE 0x18 0 long
   append
   log MEMORY_FILE C1 0x24
   append
   putVarChr MEMORY_FILE 0x50 0xc5233200 long
   putVarChr MEMORY_FILE 0x54 0x90913200 long
   putVarChr MEMORY_FILE 0x58 0x90913200 long
   putVarChr MEMORY_FILE 0x5c 0x90913200 long
   putVarChr MEMORY_FILE 0x60 SAMPLES long
   putVarChr MEMORY_FILE 0x64 SIZE long
   putVarChr MEMORY_FILE 0x68 FREQ long
   putVarChr MEMORY_FILE 0x70 CH long
   putVarChr MEMORY_FILE 0x74 SIZE long
   putVarChr MEMORY_FILE 0x78 2 long
   append
   log MEMORY_FILE C2 0x24
   append
   putVarChr MEMORY_FILE 0xa8 0x3200 long
   putVarChr MEMORY_FILE 0xbf 0 byte
   append
   log MEMORY_FILE OFFSET SIZE
   append
   string NAME += ".dsp"
   log NAME 0 PSIZE MEMORY_FILE
endfunction


Lemony Snicket's A Series of Unfortunate Events (PS2)

Code: Select all

# Lemony Snicket's A Series of Unfortunate Events (PS2) - streams.res

# (c) 2022-01-17 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring "res"
goto 8
get INFO long
get UNK long
get DATA_START long
get UNK long
get FILES long
math FILES /= 0x70
goto INFO
for i = 0 < FILES
   get CODEC short
   get CH short
   get FREQ long
   get SIZE long
   get OFFSET long
   math OFFSET += DATA_START
   getDstring DUMMY 0x60
   putArray 0 i CODEC
   putArray 1 i CH
   putArray 2 i FREQ
   putArray 3 i SIZE
   putArray 4 i OFFSET
next i
get FILES long
get UNK long
savepos OFF
for i = 0 < FILES
   goto OFF
   get NAMEOFF long
   get DUMMY longlong
   savepos OFF
   xmath NAMEOFF "OFF - 0xc + NAMEOFF"
   goto NAMEOFF
   get NAME string
   getArray CH 1 i
   getArray FREQ 2 i
   getArray SIZE 3 i
   getArray OFFSET 4 i
   set INTERLEAVE 0x10
   callfunction SS2 1
next i

startfunction SS2
   xmath PSIZE "SIZE + 0x28"
   putVarChr MEMORY_FILE PSIZE 0
   log MEMORY_FILE 0 0
   set MEMORY_FILE binary "\x53\x53\x68\x64\x18\x00\x00\x00\x10\x00\x00\x00\xb0\x36\x00\x00\x02\x00\x00\x00\xc0\x2f\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x53\x53\x62\x64\x00\xe8\x11\x00"
   append
   log MEMORY_FILE OFFSET SIZE
   append
   putVarChr MEMORY_FILE 0x24 SIZE long
   putVarChr MEMORY_FILE 0xc FREQ long
   putVarChr MEMORY_FILE 0x14 INTERLEAVE long
   putVarChr MEMORY_FILE 0x10 CH byte
   get SIZE asize MEMORY_FILE
   string NAME += ".ss2"
   log NAME 0 SIZE MEMORY_FILE
endfunction


Lemony Snicket's A Series of Unfortunate Events (Xbox)

Code: Select all

# Lemony Snicket's A Series of Unfortunate Events (Xbox) - streams.res

# (c) 2022-01-17 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org
idstring "res"
goto 8
get INFO long
get UNK long
get DATA_START long
get UNK long
get FILES long
math FILES /= 0x70
goto INFO
for i = 0 < FILES
   get CODEC short
   get CH short
   get FREQ long
   get SIZE long
   get OFFSET long
   math OFFSET += DATA_START
   getDstring DUMMY 0x60
   putArray 0 i CODEC
   putArray 1 i CH
   putArray 2 i FREQ
   putArray 3 i SIZE
   putArray 4 i OFFSET
next i
get FILES long
get UNK long
savepos OFF
for i = 0 < FILES
   goto OFF
   get NAMEOFF long
   get DUMMY longlong
   savepos OFF
   xmath NAMEOFF "OFF - 0xc + NAMEOFF"
   goto NAMEOFF
   get NAME string
   getArray CODEC 0 i
   getArray CH 1 i
   getArray FREQ 2 i
   getArray SIZE 3 i
   getArray OFFSET 4 i
   set BLOCKALIGN 4
   set BITS 16
   callfunction PCM 1
next i

startfunction PCM
   xmath PSIZE "SIZE + 0x2c"
   putVarChr MEMORY_FILE PSIZE 0
   log MEMORY_FILE 0 0
   set MEMORY_FILE binary "\x52\x49\x46\x46\x20\xC0\xB1\x00\x57\x41\x56\x45\x66\x6D\x74\x20\x10\x00\x00\x00\x01\x00\x02\x00\x44\xAC\x00\x00\x10\xB1\x02\x00\x04\x00\x10\x00\x64\x61\x74\x61\xFC\xBF\xB1\x00"
   append
   log MEMORY_FILE OFFSET SIZE
   append
   set RIFFSIZE SIZE
   math RIFFSIZE += 36
   set AVGBYTES FREQ
   if CODEC != 2
      math AVGBYTES *= BLOCKALIGN
   endif
   
   putvarchr MEMORY_FILE 0x04 RIFFSIZE long
   putvarchr MEMORY_FILE 0x14 CODEC short          # wFormatTag: Microsoft PCM Format (0x0001)
   putvarchr MEMORY_FILE 0x16 CH short   # wChannels
   putvarchr MEMORY_FILE 0x18 FREQ short   # dwSamplesPerSec
   putvarchr MEMORY_FILE 0x1c AVGBYTES long    # dwAvgBytesPerSec
   putvarchr MEMORY_FILE 0x20 BLOCKALIGN short # wBlockAlign
   putvarchr MEMORY_FILE 0x22 BITS short       # wBitsPerSample
   putvarchr MEMORY_FILE 0x28 SIZE long
   string NAME += ".wav"
   log NAME 0 PSIZE MEMORY_FILE
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:07 pm, edited 4 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

The Elder Scrolls III: Morrowind (PC/Xbox)

Code: Select all

# The Elder Scrolls III: Morrowind (PC/Xbox) - Morrowind.bsa
#
# (c) 2022-01-27 by AlphaTwentyThree of ZenHAX
# script for QuickBMS http://quickbms.aluigi.org

get DUMMY long # 0x100
get TOC_SIZE long
xmath BIAS "TOC_SIZE + 0xc"
get FILES long
get BNAME basename
xmath TEST "TOC_SIZE - (8*FILES)"
if TEST == 0
   callfunction simple 1
   cleanexit
endif

for i = 0 < FILES
    get SIZE long
    get OFFSET long
   putArray 0 i OFFSET
   putArray 1 i SIZE
next i
for i = 0 < FILES
   get NAMEOFF long
   putarray 2 i NAMEOFF
next i
savepos NAME_BIAS
for i = 0 < FILES
   getArray OFFSET 0 i
   math OFFSET += BIAS
   getArray SIZE 1 i
   getArray NAMEOFF 2 i
   math NAMEOFF += NAME_BIAS
   goto NAMEOFF
   get NAME string
   log NAME OFFSET SIZE
next i

startfunction simple
   for i = 1 <= FILES
      get SIZE long
      get OFFSET long
      math OFFSET += BIAS
      string NAME p "%s_%d" BNAME i
      log NAME OFFSET SIZE
   next i
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:06 pm, edited 4 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Disney Infinity 2.0 (PSP)

Code: Select all

# game: Disney Infinity 2.0
# file: MasterFile.dat/ManifestFile.dat
# script type: extractor
#
# (c) 2022-06-11 by AlphaTwentyThree of ZenHax
# (with contribution: DKDave of ZenHax)
# script for QuickBMS http://quickbms.aluigi.org

open FDSE ManifestFile.dat 0
open FDSE MasterFile.dat 1
get TOC_SIZE asize 0
goto 1 0

For i = 0
   getCT HASH string 0x2c
   getCT OFFSET string 0x2c
   getCT SIZE string 0x2c
   math HASH = HASH
   math OFFSET = OFFSET
   math SIZE = SIZE
   savepos TEMP
   
   goto OFFSET 1
   getDstring TEST 4 1
   if TEST == "FSB5"
      set EXT "fsb"
   elif TEST == "KB2i"
      set EXT "bik"
   elif TEST == "RIFF"
      set EXT "fev"
   elif TEST == "NAME"
      set EXT "nam"
   elif TEST == "SMAP"
      set EXT "map"
   else
      goto OFFSET 1
      getDstring TEST 3 1
      if TEST == "DLG"
         set EXT "dlg"
      else
         goto OFFSET 1
         getDstring TEST 2 1
         if TEST == "PK"
            set EXT "zip"
         endif
      endif
   endif
   string FNAME P "%EXT%\%HASH%.%EXT%"
   log FNAME OFFSET SIZE 1
   goto TEMP 0
   if TEMP == TOC_SIZE
      cleanexit
   endif
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:06 pm, edited 3 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Astonishia 2/Crimson Gem Saga (PSP)

Code: Select all

# Astonishia 2/Crimson Gem Saga (PSP) - asto2.dat

# (c) 2022-06-12 by AlphaTwentyThree of zenhax
# (contribution by spiritovod of zenhax)
# script for QuickBMS http://quickbms.aluigi.org

comtype unzip_dynamic
get FILES long

for i = 0 < FILES
   savepos MYOFF
   get NAME unicode
   math MYOFF += 0x100
   goto MYOFF
   get OFFSET long
   get SIZE long
   savepos MYOFF
   goto OFFSET
   getDstring TEST 4
   if TEST == "zlib"
      callfunction extract 1
   else
      log NAME OFFSET SIZE
   endif
   goto MYOFF
next i

startfunction extract
   log MEMORY_FILE 0 0
   xmath ENDOFF "OFFSET + SIZE"
   savepos OFFSET
   append
   for OFFSET = OFFSET < ENDOFF
      get SIZE long
      savepos OFFSET
      clog MEMORY_FILE OFFSET SIZE SIZE
      math OFFSET + SIZE
      goto OFFSET
   next
   append
   get SIZE asize MEMORY_FILE
   log NAME 0 SIZE MEMORY_FILE
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:06 pm, edited 5 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Burnout Dominator (PSP)

Code: Select all

# Burnout Dominator - fxp extractor

# (c) 2022-06-13 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring FX1?

goto 0xc
get FILES long
get FSIZE long
get DUMMY long
get TOCSIZE long
get UNK long
savepos OFF
math OFF += 0x80
xmath NAMESOFF "0xa0 + TOCSIZE"
goto OFF
for i = 0 < FILES
   get NAMEPOS long
   math NAMEPOS += NAMESOFF
   get SIZE long
   get OFFSET long
   math OFFSET *= 0x800
   getDstring DUMMY 0x18
   savepos OFF
   goto NAMEPOS
   get NAME string
   goto OFF
   log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:05 pm, edited 3 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

DJMax Dechnika Tune (PS Vita)

Code: Select all

# DJMax Dechnika Tune (PS Vita) - *.pak

# (c) 2022-06-14 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

goto 0xc
get ENTRIES long # includes folder commands
goto 0x24
get TOC long
goto TOC
set D -1 # folder deepness
for i = 1 <= ENTRIES
   get NAMEL short
   getDstring TNAME NAMEL # temporary name
   math NAMEL -= 1
   getVarChr TEST TNAME NAMEL
   if TEST == 0x2f # /
      getVarChr TEST TNAME 0
      if TEST != 0x2e
         math D += 1 # deepness+1
         putArray D 0 TNAME # enter current folder
         getArray TEMP D 0
      else # ../
         putArray D 0 "" # delete last array entry
         math D -= 1 # deepness-1
      endif
   else
      set NAME ""
      for f = 0 <= D
         getArray FOLDER f 0
         string NAME += FOLDER
      next f
      string NAME += TNAME
      get OFFSET long
      get ZERO long
      savepos MYOFF
         goto OFFSET
         get TEMP long
         get ZERO long
         get SIZE long
         math OFFSET += 0x28
         log NAME OFFSET SIZE
      goto MYOFF
   endif
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:05 pm, edited 3 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Astonishia Story 2/Crimson Gem Saga (PSP)

Code: Select all

# Astonishia 2/Crimson Gem Saga (PSP) - *.evp/*.bvp

# (c) 2022-06-14 by AlphaTwentyThree of zenhax
# script for QuickBMS http://quickbms.aluigi.org

get FSIZE asize

get EXT extension
if EXT == "evp"
   callfunction proc_evp
elif EXT == "bvp"
   callfunction proc_bvp
endif

startfunction proc_evp
   set OFFSET 0x20
   do
      goto OFFSET
      get SIZE long
      savepos OFFSET
      callfunction write 1
      math OFFSET += SIZE
   while OFFSET != FSIZE
endfunction

startfunction proc_bvp
   set OFFSET 0
   xmath GO "FSIZE - 0x30"
   goto GO
   for i = 1
      get SIZE long
      if SIZE == 0
         break
      endif
      savepos MYOFF
      callfunction write 1
      math OFFSET += SIZE
      goto MYOFF
   next i
endfunction

startfunction write
   goto OFFSET
   getDstring TEMP 0x20
   getDstring NAME 0x20
   string NAME += ".vag"
   log NAME OFFSET SIZE
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:01 pm, edited 2 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Tt Fusion Ltd. games
(https://www.mobygames.com/company/tt-fusion-ltd)

Code: Select all

# Tt Fusion Ltd. games - fmv audio extractor
# resulting files can be played with vgmstream (txth is always needed)
# https://www.mobygames.com/company/tt-fusion-ltd

# (c) 2022-06-14 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

log MEMORY_FILE 0 0
get FSIZE asize
idstring FMV!
set PRE 1
callfunction demux 1

set MEMORY_FILE binary "\x63\x6F\x64\x65\x63\x20\x3D\x20\x44\x56\x49\x5F\x49\x4D\x41\x0D\x0A\x73\x61\x6D\x70\x6C\x65\x5F\x72\x61\x74\x65\x20\x3D\x20\x40\x30\x24\x34\x0D\x0A\x63\x68\x61\x6E\x6E\x65\x6C\x73\x20\x3D\x20\x40\x36\x24\x31\x0D\x0A\x73\x74\x61\x72\x74\x5F\x6F\x66\x66\x73\x65\x74\x20\x3D\x20\x30\x78\x38\x0D\x0A\x6E\x75\x6D\x5F\x73\x61\x6D\x70\x6C\x65\x73\x20\x3D\x20\x64\x61\x74\x61\x5F\x73\x69\x7A\x65\x20\x2D\x20\x73\x74\x61\x72\x74\x5F\x6F\x66\x66\x73\x65\x74"
string NAME += ".txth"
log NAME 0 0x70 MEMORY_FILE

startfunction demux
   set SIZE 8 # plus header
   if PRE == 0
      goto 0x20
      getDstring DATA 8
      putDstring DATA 8 MEMORY_FILE
   endif
   goto 0x28
   for i = 1
      getDstring IDENT 4
      get BLOCKSIZE long
      savepos MYOFF
      math MYOFF += BLOCKSIZE
      if IDENT == "FMA" && PRE == 0
         getDstring DATA BLOCKSIZE
         putDstring DATA BLOCKSIZE MEMORY_FILE
      elif IDENT == "FMA" && PRE == 1
         math SIZE += BLOCKSIZE
      endif
      goto MYOFF
      if MYOFF == FSIZE
         break
      endif
   next i
   if PRE == 1
      putVarChr MEMORY_FILE SIZE 0
      log MEMORY_FILE 0 0
      set PRE 0
      callfunction demux 1
   else
      get SIZE asize MEMORY_FILE
      get NAME basename
      string NAME += ".ima"
      log NAME 0 SIZE MEMORY_FILE
   endif
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:02 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Gust Co.
(https://www.mobygames.com/company/gust-co-ltd)

Code: Select all

# Ayesha no Atelier: Tasogare no Daichi no Renkinjutsushi (PSP)
# - gvd.dat
# - *.gvd

# (c) 2022-06-14 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

endian big
getdstring IDENT 4
if IDENT == "TGDT"
   callfunction TGDT 0
elif IDENT == "GVEW"
   callfunction GVEW 0
else
   print "Unsupported archive format!"
endif

startfunction TGDT
   getDstring VER 4
   get FILES long
   get BIAS long
   for i = 0 < FILES
      get NAMEPOS long
      math NAMEPOS += BIAS
      get UNK long
      get OFFSET long
      math OFFSET += BIAS
      get SIZE long
      savepos MYOFF
      goto NAMEPOS
      getDstring NAME 0x400
      goto MYOFF
      log NAME OFFSET SIZE
   next i
endfunction

startfunction GVEW
   get FSIZE asize
   get BNAME basename
   goto 0x1c
   get TOC_SIZE long
   xmath FILES "(TOC_SIZE - 8) / 0x20"
   xmath OFFSET "TOC_SIZE + 0x38"
   goto 0x30
   for i = 0 < FILES
      get ID1 long
      get ID2 long
      get ID3 long
      get SIZE long
      get ID5 long
      get ZERO long
      get x_dim long
      get y_dim long
      string NAME p "%s/%s_%s_%s_%s.jpg" BNAME ID1 ID2 ID3 ID5
      savepos MYOFF
      goto OFFSET
      do
         savepos OFFSET
         get TEST byte
      while TEST == 0xff
      math OFFSET -= 1
      goto MYOFF
      log NAME OFFSET SIZE
      math OFFSET += SIZE
   next i
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:02 pm, edited 2 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Mahou Shoujo Lyrical Nanoha A's Portable DLCs (PSP)

Code: Select all

# Mahou Shoujo Lyrical Nanoha A's Portable (PSP)
#
# (c) 2022-06-14 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring GPDA
get FSIZE long
get ZERO long
get FILES long
get BNAME basename
for i = 0 < FILES
   get OFFSET long
   get DUMMY long
   get SIZE long
   get NAMEPOS long
   savepos MYOFF
   goto NAMEPOS
   get NAMEL long
   getDstring FNAME NAMEL
   goto MYOFF
   string NAME p "%s/%s" BNAME FNAME
   log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:03 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

WAVE scanner

file type: any
script type: scanne
notes:
- new version with more name retrieval support and type recognition
- wave headers MUST begin with RIFF/RIFFX
- stream sizes automatically corrected in header (otherwise certain files aren't playable with vgmstream)
- script still fully commented
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

帝国海軍恋慕情~明治横須賀行進曲 (Imperial Navy Love Affection - Meiji Yokosuka March) (PS Vita)

note: resulting at9 files need to be run through the above scanner to play with vgmstream (headers have wrong sizes)!

Code: Select all

# 帝国海軍恋慕情~明治横須賀行進曲 - *.hpac/*.hph
# (c) 2022-06-15 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

open FDDE hpb 1 EXIST
getDstring IDENT 4
if IDENT == "HLZS"
   comtype LZSS0
   get UNK long
   get CSIZE long
   get SIZE long
   clog TEMPORARY_FILE 0x20 CSIZE SIZE
   open FDSE TEMPORARY_FILE 0
endif
callfunction HPAC 1

startfunction HPAC
   goto 0
   getDstring IDENT 4
   if IDENT == "HGTC"
      callfunction HGTC 1
   elif IDENT == "HPAC"
   else
      print "Unsupported archive format, please contact me."
   endif
   get UNK long
   get FILES long
   get HSIZE long
   get NAMEOFF long
   goto 0x20
   for i = 1 <= FILES
      get HASH1 long
      get OFFSET long
      get SIZE long
      get UNK1 long
      get HASH2 long
      get UNK2 long
      getDstring ZERO 8
      savepos MYOFF
      goto NAMEOFF
      get NAME string
      savepos NAMEOFF
      goto MYOFF
      log NAME OFFSET SIZE EXIST
   next i
endfunction

startfunction HGTC
   get BNAME basename
   get UNK long
   get FILES long
   goto 0x20
   for i = 1 <= FILES
      get HASH long
      get UNK1 long
      get UNK2 long
      get DUMMY long
      get OFFSET1 long
      get OFFSET2 long
      getDstring ZERO 8
      xmath SIZE "OFFSET2 - OFFSET1"
      string NAME p "%s_%d_%08x_%d_%d_1" BNAME i HASH UNK1 UNK2
      log NAME OFFSET1 SIZE EXIST
      savepos MYOFF
      getDstring DUMMY 0x10
      if i != FILES
         get SIZE long
      else
         get SIZE asize
      endif
      math SIZE -= OFFSET2
      string NAME p "%s_%d_%08x_%d_%d_2" BNAME i HASH UNK1 UNK2
      log NAME OFFSET2 SIZE EXIST
      goto MYOFF
   next i
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:03 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Adventures to Go! (PSP)

note: no file names available, func_getTYPE.bms is needed

Code: Select all

# Adventures to Go! (PSP) - data.dat

# (c) 2022-06-15 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get BNAME basename
for i = 1
   get OFFSET long
   if OFFSET == 0
      break
   endif
   math OFFSET *= 0x800
   get SIZE long
   putVarChr MEMORY_FILE SIZE 0
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction getTYPE 1
   string NAME p "%s_%d.%s" BNAME i EXT
   log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:03 pm, edited 3 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

After Burner: Black Falcon (PSP)

Code: Select all

# After Burner: Black Falcon (PSP) - *.bag

# note: remove line 20 to disable subfolders
# (c) 2021-12-21 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get FSIZE asize
get FNAME basename
getDstring VER 4
getDstring NAMESOFF 8
math NAMESOFF = NAMESOFF
goto NAMESOFF
do
   getCT NAME binary 0x2c
   getCT SIZE binary 0x2c
   getCT OFFSET binary 0x0a
   math SIZE = SIZE
   math OFFSET = OFFSET
   savepos TEST
   string NAME p "%s/%s" FNAME NAME
   log NAME OFFSET SIZE
while TEST != FSIZE
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:04 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Army of Two: The 40th Day (PSP)

Code: Select all

# Army of Two: The 40th Day (PSP) - bigfile.dat
#
# (c) 2022-06-15 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org
#
# notes:
# - some *.mul files aren't identified correctly by getTYPE -> rename
# - duplicate CRC references (same file name) are different languages

include func_getTYPE.bms
get BNAME basename

get FILES long
for i = 0 < FILES
   get CRC long
   putArray 0 i CRC
next i

for i = 0 < FILES
   get SIZE long
   get OFFSET long
   get DUMMY long
   get DUMMY long
   math OFFSET *= 0x800
   getArray CRC 0 i
   putVarChr MEMORY_FILE SIZE 0
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction getTYPE 1
   string NAME p "%08x.%s" CRC EXT
   log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:04 pm, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Arthur and the Invisibles (PSP)

Code: Select all

# Arthur and the Invisibles (aka. Arthur and the Minimoys) *.kpp
# extracts the audio streams from KPP files

# (c) 2022-06-17 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org


set SEARCH 0

for i = 1
   goto SEARCH
   FindLoc S_OFF string \x64\x3A\x5C 0 "" # d:\
   if S_OFF == ""
      break
   endif
   xmath OFFSET "S_OFF - 0x40"
   putArray i 0 OFFSET
   xmath SEARCH "S_OFF + 0x10" # jump random forward
next i

xmath FILES "i - 1"

for i = 1 <= FILES
   getArray OFFSET i 0
   if i != FILES
      xmath k "i + 1"
      getArray SIZE k 0
   else
      get SIZE asize
   endif
   math SIZE -= OFFSET
   if SIZE > 0x80
      putVarChr MEMORY_FILE SIZE 0
      log MEMORY_FILE 0 0
      append
      log MEMORY_FILE OFFSET SIZE
      append
      callfunction getVAG 1
   endif
next i

startfunction getVAG
   goto 0 MEMORY_FILE
   get FREQ long MEMORY_FILE
   if FREQ != 22050
      break
   endif
   goto 0x40 MEMORY_FILE
   get NAME string MEMORY_FILE
   padding 0x10 MEMORY_FILE
   savepos MYOFF MEMORY_FILE
   getDstring HASH 0x20 MEMORY_FILE
   get UNK long MEMORY_FILE
   get SIZE long MEMORY_FILE
   get UNK long MEMORY_FILE
   savepos OFFSET MEMORY_FILE
   string NAME -= 4
   callfunction VAG 1
endfunction

startfunction VAG
   xmath PSIZE "SIZE + 0x30"
   putVarChr MEMORY_FILE2 PSIZE 0
   log MEMORY_FILE2 0 0
   set MEMORY_FILE2 binary "\x56\x41\x47\x70\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x04\x50\x00\x00\x22\x56\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
   append
   log MEMORY_FILE2 OFFSET SIZE MEMORY_FILE
   append
   reverselong SIZE
   reverselong FREQ
   putVarChr MEMORY_FILE2 0xc SIZE long
   putVarChr MEMORY_FILE2 0x10 FREQ long
   string NAME += ".vag"
   get SIZE asize MEMORY_FILE2
   log NAME 0 SIZE MEMORY_FILE2
endfunction
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:05 pm, edited 1 time in total.