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 »

Asterix & Obelix XXL 2 (PSP)

Code: Select all

# Asterix & Obelix XXL 2 (PSP) - *.pak
#
# (c) 2022-06-17 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring TATE
get FSIZE asize
set OFF 0x80
for i = 0
   goto OFF
   getDstring TYPE 4
   get SIZE long
   get DUMMY longlong
   getDstring NAME 0x70
   savepos OFFSET
   log NAME OFFSET SIZE
   math OFFSET += SIZE
   goto OFFSET
   do
      get TEST byte
      savepos OFF
      if OFF == FSIZE
         cleanexit
      endif
   while TEST == 0
   math OFF -= 1
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:08 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 »

Blood Bowl (PSP)

Code: Select all

# Blood Bowl (PSP) - *.cat

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

get FILES long
for i = 0 < FILES
   get NAMEL long
   getDstring NAME NAMEL
   padding 4
   get SIZE long
   savepos OFFSET
   #print "%OFFSET% %SIZE%"
   log NAME OFFSET SIZE
   math OFFSET += SIZE
   goto OFFSET
next i
Last edited by AlphaTwentyThree on Sun Jun 19, 2022 2:09 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 »

Battle Dodge Ball 3 (PSP)

note: resulting files are Visual C++ project files

Code: Select all

# Battle Dodge Ball 3 (PSP) - def_arc.irarc/.irlst

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

open FDDE irlst 0
open FDDE irarc 1

get BNAME basename
get FILES long
for i = 1 <= FILES
   get ID long
   get OFFSET long
   get SIZE long
   get TYPE long
   if TYPE == 7
      set EXT "iobj"
   elif TYPE == 0
      set EXT "ipdb"
   endif
   math OFFSET += 0x14
   math SIZE -= 0x14
   string NAME p "%s_%d.%s" BNAME ID EXT
   log NAME OFFSET SIZE 1
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

The Bigs/The Bigs 2 (PSP) - *.big

Code: Select all

# The Bigs/The Bigs 2 (PSP) - *.big
# note: uncomment line 27 to enable archive subfolders
#
# (c) 2022-06-19 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring \x04\x03\x02\x01

get UNK long
get FSIZE long
get FILES long
get UNK long
get NAMEPOS long
get BNAME basename

for i = 0 < FILES
   get UNK1 long
   get SIZE long
   get OFFSET long
   get UNK2 long
   get UNK3 long
   savepos MYOFF
   goto NAMEPOS
   get NAME string
   savepos NAMEPOS
   goto MYOFF
#   string NAME p "%s/%s" BNAME NAME
   log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Mon Jun 20, 2022 8:20 am, edited 1 time in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Astro Boy: The Video Game (PSP) - FILE1/FILE2/FILE3

note: probably also works with other games using this engine

Code: Select all

# Astro Boy: The Video Game (PSP)
# extracts the block files created by DKDave's BIGB script
# (https://zenhax.com/viewtopic.php?f=6&t=17035#p72153)
# note: only works for the music

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

get BNAME basename
string BNAME -= 1
string F1 P "%BNAME%1"
string F2 P "%BNAME%2"
string F3 P "%BNAME%3"
OPEN FDSE F2 0
OPEN FDSE F1 1
OPEN FDSE F3 3 EXIST
if EXIST == 0 # no sound files
   cleanexit
endif

get FSIZE asize
set i 1
for t = 1
   get TYPE short
   get IDENT short
   savepos TEST
   if TEST == FSIZE
      break
   endif
   get OFFSET long
   if IDENT == 0x8000 # streams only
      putArray i 0 OFFSET
      putArray i 1 TYPE
      math i += 1
   endif
next t
xmath FILES "i - 1"
set w 1
for i = 1 <= FILES
   getArray OFFSET i 0
   getArray TYPE i 1
   if i != FILES
      xmath n "i + 1"
      getArray SIZE n 0
   else
      xmath SIZE "OFFSET + 0x20" # last control file
   endif
   math SIZE -= OFFSET
   if TYPE == 275 # RIFF file
      goto OFFSET 1
      getDstring TEMP 4 1 # RIFF
      get SIZE long 1
      math SIZE += 8
      getDstring TEST 4 1
      if TEST == "WAVS"
         xmath NAMEPOS "OFFSET + 0x2c"
         goto NAMEPOS 1
         getCT NAME binary 0x2e 1
         putArray w 0 NAME
         string NAME P "%NAME%.wavs"
         log NAME OFFSET SIZE 1
         math w += 1
      endif
   endif
next i
xmath FILES "w - 1"
set SEARCH 0
for i = 1 <= FILES # _should_ be correct
   goto SEARCH 3
   FindLoc OFFSET string \x57\x41\x56\x45\x66\x6D\x74\x20 3 "" # WAVEfmt
   math OFFSET -= 8
   goto OFFSET 3
   get DUMMY long 3 # RIFF
   get SIZE long 3
   math SIZE += 8
   getDstring DUMMY 0xc 3
   get CODEC short 3
   if CODEC == 0xfffe || CODEC == 0x720
      set EXT ".at3"
   elif CODEC == 1
      set EXT ".wav"
   else
      set EXT ".lwav"
   endif
   getArray NAME i 0
   string NAME += EXT
   log NAME OFFSET SIZE 3
   xmath SEARCH "OFFSET + SIZE"
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Brian Lara 2007 Pressure Play (PSP) - *.tar

Code: Select all

# Brian Lara 2007 Pressure Play (PSP) - *.tar
#
# (c) 2022-06-20 by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get FILES long
for i = 0 < FILES
   get NAMEL long
   getDstring NAME NAMEL
   get SIZE long
   get OFFSET long
   putArray i 0 NAME
   putArray i 1 OFFSET
   putArray i 2 SIZE
next i
savepos BIAS
for i = 0 < FILES
   getArray NAME i 0
   getArray OFFSET i 1
   getArray SIZE i 2
   math OFFSET += BIAS
   log NAME OFFSET SIZE
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Brunswick Pro Bowling (PSP) - *.wad

Code: Select all

# Brunswick Pro Bowling (PSP) - *.wad

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

get FSIZE asize
get FOLDER string
goto 0x1a
get FILES short
if FILES == 0
   callfunction VAR 0
endif
for i = 1 <= FILES
   get UNK long
   getDstring BNAME 0x10
   getDstring EXT 4
   get OFFSET long
   get SIZE long
   get ID long
   string NAME P "%FOLDER%/%BNAME%.%EXT%"
   putArray i 0 OFFSET
   putArray i 1 NAME
next i
sortArray 0 0
for i = 1 <= FILES
   getArray OFFSET i 0
   getArray NAME i 1
   if i != FILES
      xmath n "i + 1"
      getArray SIZE n 0
   else
      get SIZE asize
   endif
   math SIZE -= OFFSET
   log NAME OFFSET SIZE
next i

startfunction VAR
   goto 0x24
   get FILES long
   get UNK long
   savepos NAMEPOS
   xmath NAMEPOS "NAMEPOS + FILES * 0x10"
   for i = 1 <= FILES
      get OFFSET long
      math OFFSET += 0x20
      get ZERO long
      get SIZE long
      get UNK long
      savepos OFF
      goto NAMEPOS
      get NAME string
      savepos NAMEPOS
      goto OFFSET
      getDstring TYPE 4
      if TYPE == "VAGp"
         set EXT "vag"
      endif
      goto OFF
      string NAME P "%FOLDER%/%NAME%.%EXT%"
      log NAME OFFSET SIZE
      goto OFF
   next i
endfunction
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

The Bigs/The Bigs 2 (PSP) - *.bcv

Code: Select all

# The Bigs/The Bigs 2 (PSP) - *.bcv

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

idstring BCVA
get BNAME basename
get FILES long
if FILES != 2
   cleanexit
endif
get TEMP long
get INTERLEAVE long
math INTERLEAVE -= 0x30
xmath PSIZE "2*INTERLEAVE"
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"
goto 0xc
append
for i = 1 <= 2
   get SIZE long
   get OFFSET long
   math OFFSET += 0x30
   math SIZE -= 0x30
   log MEMORY_FILE OFFSET SIZE
next i
append
xmath OFF "OFFSET - 0x20"
goto OFF
get FREQ long
reverselong FREQ
set CH 2
putVarChr MEMORY_FILE 0x24 PSIZE 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 "%BNAME%.ss2"
log NAME 0 SIZE MEMORY_FILE
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Blitz: Overtime (PSP) - *.ms2/*.ms4

Code: Select all

# Blitz: Overtime (PSP) - *.ms2/*.ms4

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

include func_getTYPE.bms

get BNAME basename
for i = 1
   get ID short
   get UNK2 short # 0x2000 or 0
   get OFFSET long
   get SIZE long
   savepos MYOFF
      putVarChr MEMORY_FILE SIZE 0
      log MEMORY_FILE 0 0
      append
      log MEMORY_FILE OFFSET SIZE
      append
      callfunction getTYPE 1
   goto MYOFF
   string NAME P "%BNAME%_%ID%.%EXT%"
   if OFFSET != 0
      log NAME OFFSET SIZE
   else
      cleanexit
   endif
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Bounty Hounds (PSP) - *.xpk

Code: Select all

# Bounty Hounds (PSP) - *.xpk

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

comtype gzip
idstring XPK
getDstring VER 4
goto 8
get FILES long
for i = 0 < FILES
   getDstring NAME 0x44
   get DUMMY threebyte
   get C byte
   get OFFSET long
   math OFFSET *= 0x800
   get SIZE long
   get CSIZE long
   getDstring DUMMY 0x2c
   if C != 0
      clog NAME OFFSET CSIZE SIZE
   else
      log NAME OFFSET CSIZE
   endif
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Curve Studios Limited - *.pak
(https://www.mobygames.com/company/curve-studios-limited)

Code: Select all

# Curve Studios Limited - *.pak

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

idstring \xcd\xcd\xcd\xcd

get FILES long
get TOC long
xmath NAMEOFF "TOC + FILES*0xc"
goto TOC
for i = 0 < FILES
   get CRC long
   get OFFSET long
   get SIZE long
   savepos OFF
   goto NAMEOFF
   get NAME string
   savepos NAMEOFF
   goto OFF
   log NAME OFFSET SIZE
next i
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by AlphaTwentyThree »

Buzz! Concurso Universal (PSP) - *.flz

Code: Select all

# Buzz! Concurso Universal (PSP) - *.flz

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

get BNAME basename
get FSIZE asize
set OFFSET 0
for i = 1
   goto OFFSET
   getDstring TYPE 3
   if TYPE == "TEX"
      set EXT "tex"
   elif TYPE == "VAG"
      set EXT "vag"
   elif TYPE == "ANK"
      set EXT "ank"
   else
      set EXT "dat"
   endif
   FindLoc SIZE binary \x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55 0 ""
   math SIZE -= OFFSET
   string NAME P "%BNAME%/%i%.%EXT%"
   log NAME OFFSET SIZE
   math OFFSET += SIZE
   goto OFFSET
   padding 0x10
   savepos OFFSET
   callfunction NXT 1
next i

startfunction NXT
   do
      math OFFSET += 0x10
      if OFFSET >= FSIZE
         cleanexit
      endif
      goto OFFSET
      get TEST long
   while TEST == 0x55555555
endfunction
sanderson169
Posts: 8
Joined: Mon Aug 22, 2022 1:02 pm

Re: My QuickBMS scripts

Post by sanderson169 »

[quote="AlphaTwentyThree"]Wwise sound engine

file types: archives with AKPK identifier and *.bnk / *.txt and soundbanks.xml
script type: extractor / parser

Second script is for extraction, first script for name parsing.
To parse, keep all extracted files in the same folder as the *.txt and soundbanks.xml. Priority in parsing is always the soundbanks.xml. You can parse again with the txt files afterwards. After parsing, ALWAYS check with Anti-Twin (or similar) if there are files without name (which still have their IDX).

PARTLY REDUNDANT DUE TO Wwiser!!! (https://github.com/bnnm/wwiser)

Code: Select all

# file types: Wwise sound engine AKPK and BNK archives
# script type: extractor
# note 1: all files extracted as *.wem
# note 2: after extraction, parse with script
# for the soundbanks.xml or *.txt (if available)
#
# (c) by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get BNAME basename
getDstring IDENT 4
if IDENT == "AKPK"
   callfunction AKPK 1
elif IDENT == "1KCP" # The Saboteur (PC)
   callfunction AKPK 1
elif IDENT == "BKHD"
   callfunction BKHD 1
else
   print "Error: no valid Wwise sound pack"
   cleanexit
endif

startfunction AKPK
   set PC 0
   endian big
   get SIZE_HEADER long # data start offset
   get TEST long
   get FSIZE asize
   if TEST != 1
      reverselong SIZE_HEADER
      endian little
      set PC 1
   endif
   get BNAME basename
   string BNAME += " "

   goto 0xc
   get IDENT long
   set FOLDER_NAMES 1
   if IDENT == 0xc6
      set NBIAS 0x18
   elif IDENT == 0x14
      set NBIAS 0x1c
      set PC 1
   else
      set NBIAS 0x1c # also in PC versions
   endif
   goto NBIAS
   get NUM_FOLDERS long
   if NUM_FOLDERS > 10
      math NBIAS -= 4
      goto NBIAS
      get NUM_FOLDERS long
   endif
   savepos MYOFF
   set INFO NUM_FOLDERS
   math INFO *= 8
   math INFO += MYOFF # = start of names, will hold offset to jump to for TOC
   set ALLNAMES 0 # for ceil after names

   for i = 0 < NUM_FOLDERS
      goto MYOFF
      get OFF_NAME_FOLDER long
      math OFF_NAME_FOLDER += NBIAS
      get ID_FOLDER long
      savepos MYOFF
      goto OFF_NAME_FOLDER
      if PC == 0
         get NAME_FOLDER string
      else
         callfunction getPCstring 1
      endif
         strlen LENGTH NAME_FOLDER
         math ALLNAMES += LENGTH
         math ALLNAMES += 1
      string NAME_FOLDER += "/"
      string NAME_FOLDER += BNAME
      putArray 0 ID_FOLDER NAME_FOLDER
   next i
   if PC == 1
      math ALLNAMES *= 2
      math INFO += ALLNAMES
   else
      savepos INFO
      math INFO x= 4
   endif
   goto INFO
   set RUNS 1
   callfunction extract 1
   cleanexit
endfunction

startfunction BKHD
   get TEST short
   set REV 0
   if TEST == 0
      set REV 1
      endian big
   endif
   goto 4
   get SIZE_HEADER long
   savepos MYOFF
   math MYOFF += SIZE_HEADER
   get FSIZE asize
   if MYOFF == FSIZE
      print "bnk is empty"
      cleanexit
   endif
   goto MYOFF
   idstring "DIDX"
   get SIZE_DIDX long
   set FILES SIZE_DIDX
   math FILES /= 0xc
   set BIAS MYOFF # complete header
   math BIAS += SIZE_DIDX
   math BIAS += 16
   get BNAME basename
   for i = 1 <= FILES
      get DIDX long
      get OFFSET long
      math OFFSET += BIAS
      get SIZE long
      set NAME DIDX
      string NAME p= "%s.wem" DIDX EXT
      log NAME OFFSET SIZE
   next i
endfunction

startfunction getPCstring
   set NAME_FOLDER ""
   for s = 0
      get CHAR byte
      get NULL byte
      putVarChr NAME_FOLDER s CHAR
      if CHAR == 0
         break
      endif
   next s
endfunction
   
startfunction extract
   savepos INFO
   get NUM_FILES long
   if NUM_FILES == 0
      if RUNS == 1
         get NUM_FILES long
      else
         cleanexit
      endif
   endif
   print "extracting %NUM_FILES% files (number at offset %INFO%)"
   for i = 1 <= NUM_FILES
      get NAME_CRC long
      get MULTI long # in certain cases only
      get SIZE long
      if SIZE == 0
         get SIZE long
      endif
      get OFFSET long
      get ID_FOLDER long
      if OFFSET == 0
         set OFFSET ID_FOLDER
         get ID_FOLDER long
      endif
      #string NAME_CRC p= "0x%08x" NAME_CRC      
      if MULTI != 0
         math OFFSET *= MULTI
      endif
      savepos MYOFF
      if PC == 0
         endian big
      endif
      string NAME_CRC += ".wem"
      log NAME_CRC OFFSET SIZE
   next i
   math RUNS += 1
   callfunction extract 1
endfunction


any update about the WWISE PARSE? :3

I have introduced .json or .txt files and it does not recognize them, only with xml.

i am ussing this for dead by daylight audios and get the names parser but it's too slow...
Rocher
Posts: 1
Joined: Tue Sep 27, 2022 9:58 am

Re: My QuickBMS scripts [AlphaTwentyThree]

Post by Rocher »

I ve been trying to use this bms script to open arc file from the Dissidia 012 game. But i don t know what to look out for in order to edit the script to display the data contained in the file.
What kind of methodology did you use in order to know how to parse the arc files ?