[script] EA mus to wave

Codecs, formats, encoding/decoding of game audio, video and music
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

[script] EA mus to wave

Post by AlphaTwentyThree »

Hi there!

Sometimes EA games use files that look like EA MUS but are in reality just wave or AT3 files, e.g. Medal of Honor: Heroes 2 for PSP. The following script parses those files.

Code: Select all

# parse pseudo EA MUS files to wave
# written by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring "SCHl" # header
get BLOCKSIZE long
goto BLOCKSIZE
savepos OFFSET
getDstring IDENT 4
get BLOCKSIZE long
math OFFSET += BLOCKSIZE
log MEMORY_FILE 0 0
for
   goto OFFSET
   getDstring IDENT 4
   if IDENT == "SCEl"
      get NAME basename
      string NAME += ".wav"
      get SIZE asize MEMORY_FILE
      log NAME 0 SIZE MEMORY_FILE
      cleanexit
   endif
   get SIZE long
   math SIZE -= 0x18
   math OFFSET += 0x18
   append
   log MEMORY_FILE OFFSET SIZE
   append
   math OFFSET += SIZE
next