XBLA flog_x360.fpg extractor
Two games found so far. The sg2 files inside the archives hold their file name each which is pretty neat.
Update your func_getTYPE.bms for that option!
# extracts contents of FPG archives
#
# supported games:
# - Super Puzzle Fighter II Turbo - HD Remix (XBLA)
# - Super Street Fighter II Turbo - HD Remix (XBLA)
#
# (c) 2012-04-04 by AlphaTwentyThree of XeNTaX
include "func_getTYPE.bms"
idstring "30GF"
get FILES long
goto 0x800
for i = 1 <= FILES
get NAME_CRC long
string NAME_CRC p= "%08x" NAME_CRC
get OFFSET long
get SIZE long
get ZSIZE long
if SIZE == ZSIZE
putVarChr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0
log MEMORY_FILE OFFSET SIZE
else
putVarChr MEMORY_FILE ZSIZE 0
log MEMORY_FILE 0 0
clog MEMORY_FILE OFFSET SIZE ZSIZE
set SIZE ZSIZE
endif
callfunction getTYPE 1
if ZNAME != ""
set NAME ZNAME
else
get NAME basename
string NAME += "_0x"
string NAME += NAME_CRC
endif
string NAME += EXT
log NAME 0 SIZE MEMORY_FILE
next i
# extracts pfp files with PFPK identifier
# supported games:
# - Strimko (PC)
# - Witch Hunters: Stolen Beauty (PC, BigFish Games)
# - Strange Cases: The Secret of Grey Mist Lake (PC, 2012, BigFish Games)
#
# (c) 2012-04-08 by AlphaTwentyThree of XeNTaX
idstring "PFPK"
get FILES long
for i = 1 <= FILES
get NAMEL byte
getDstring NAME NAMEL
get OFFSET long
get SIZE long
log NAME OFFSET SIZE
next i
Last edited by AlphaTwentyThree on Sat Oct 27, 2012 5:14 am, edited 2 times in total.
Resident Evil: Operation Raccoon City (Xbox 360) - streamed.pck
I know that other games use this format, too but I need to find out how to automatically retrieve those variables behind the goto commands first.
For now, you can use this just for one game. I'll update this post when I update the script.
func_getTYPE.bms: viewtopic.php?f=13&p=69577#p69577
# extracts the contents of the streamed.pck of Resident Evil: Operation Raccoon City (Xbox 360)
#
# (c) 2012-04-07 by AlphaTwentyThree of XeNTaX
include "func_getTYPE.bms"
idstring "AKPK"
endian big
set FOLDEROFF 0x58
goto 0x18
for i = 0 <= 7
get DUMMY long
get INDEX long
savepos MYOFF
goto FOLDEROFF
for k = 0 < INDEX
get FOLDERNAME string
next k
putArray 0 INDEX FOLDERNAME
goto MYOFF
next i
goto 0xa4
get FILES long
for i = 1 <= FILES
get NAME_CRC long
string NAME_CRC p= "%08x" NAME_CRC
get MULTIPLIER long
get SIZE long
get OFFSET long
math OFFSET *= MULTIPLIER
get TYPE long # folder number
get FNAME basename
string FNAME += "_0x"
string FNAME += NAME_CRC
getArray WNAME 0 TYPE
string WNAME += "/"
string WNAME += FNAME
log MEMORY_FILE OFFSET SIZE
callfunction getTYPE 1
endian big
string WNAME += EXT
log WNAME 0 SIZE MEMORY_FILE
next i
Just updated my SS2 header adder to a more sophisticated script with the use of the include function. The old onw still works but this additionally has a memory preallocation and thus is multiple times faster. Practical when you batch big files.
rws_to_ss2.bms
Some PS2 games use the rws header. Those files can be played with vgmstream but the plugin doesn't take the name from the RWS header. My script does.
This is a good example how easy header manipulations get with my adjusted func_header_SS2.bms!
# convert PS2 ADPCM RWS header to SS2 header
# (c) 2012-04-10 by AlphaTwentyThree of XeNTaX
include "func_header_SS2.bms"
idstring \xd\x8\x0\x0
goto 0x48
get OFFSET long
goto 0x68
get NAME string
string NAME += ".ss2"
goto 0x90
get SIZE long
goto 0xD4
get INTERLEAVE short
goto 0xE4
get FREQ short
goto 0xF1
get CH byte
callfunction SS2 1
# extracts the TUNES.DAT/.TAB and SPEECH.DAT/.TAB from
# Broken Sword: Shadow of the Templars (PSX)
# (c) 2012-04-10 by AlphaTwentyThree of XeNTaX
include "func_header_SS2.bms"
open FDDE DAT 0
open FDDE TAB 1
get FILES asize 1
math FILES /= 0x8
for i = 1 <= FILES
get OFFSET long 1
math OFFSET *= 0x800
get SIZE long 1
if SIZE == 0xffffffff
elif SIZE == 0
else
set FREQ 11025
set CH 1
set INTERLEAVE 0x10
get NAME basename 1
string NAME += "_"
string NAME += i
string NAME += ".ss2"
callfunction SS2 1
endif
next i
While working on several older console games, I encountered this format first in Saturn, then in Sega CD games. The audio has no info, but there's some infor area after the block info, which is saved. Sometimes the audio is just Motorola (big endian) raw PCM, normally mono but I also encountered an audio format which I have never seen.
Used a workaround to pre-allocate the memory file, so it's pretty fast for bigger files, too.
# extracts the raw audio stream from Sega Saturn and Sega CD movies with FILM signature
# e.g. found in:
# - 3 Ninjas Kick Back (SCD)
# - Shellshock (SS)
# - Tomb Raider (SS)
# - X-Men: Children of the Atom (SS)
# (c) 2012-08-09 by AlphaTwentyThree of XeNTaX
endian big
idstring "FILM"
get BIAS long
getDstring VER 4
get ZERO long
idstring "FDSC"
get STAB_OFF long
math STAB_OFF += 0x10
goto STAB_OFF
idstring "STAB"
get STAB_SIZE long
get UNK long
get ENTRIES long
savepos MYOFF
set OFF_HEADER ENTRIES
math OFF_HEADER *= 0x10
math OFF_HEADER += MYOFF
set SIZE_HEADER BIAS
math SIZE_HEADER -= OFF_HEADER
set PSIZE 0
for p = 0 < 2
for i = 1 <= ENTRIES
get OFFSET long
math OFFSET += BIAS
get SIZE long
get UNK long
get TYPE long
if TYPE == 1 # audio
if p == 0
math PSIZE += SIZE
else
append
log MEMORY_FILE OFFSET SIZE
append
endif
endif
next i
if p == 0
putVarChr MEMORY_FILE PSIZE 0
log MEMORY_FILE 0 0
endif
goto MYOFF
next p
get SIZE asize MEMORY_FILE
get NAME basename
string NAME += ".raw"
log NAME 0 SIZE MEMORY_FILE
get NAME basename
string NAME += ".info"
log NAME OFF_HEADER SIZE_HEADER
Last edited by AlphaTwentyThree on Thu Aug 09, 2012 1:18 am, edited 2 times in total.
func_header_PCM.bms
Like the name tell you: just a header adder for standard wave pcm. Somehow I forgot to post it here.
BTW: standard wave files have CODEC 1, BITS 16, but the BLOCKALIGN may vary between 1 and 4.
# 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
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
include "func_header_PCM.bms"
set OFFSET 0
get SIZE asize
math SIZE -= OFFSET
set CODEC 1
set FREQ 44100
set CH 2
set BITS 16
set BLOCKALIGN 4
set NAME ""
callfunction PCM 1
Last edited by AlphaTwentyThree on Tue Oct 16, 2012 11:06 pm, edited 3 times in total.
# converts the str files from Scarygirl (PC) to standard wave files
# (c) 2012-04-16 by AlphaTwentyThree of XeNTaX
include "func_header_PCM.bms"
get CODEC short
get CH short
get FREQ long
get AVGBYTES long
get BLOCKALIGN short
get BITS short
get UNK long
get UNK long
savepos OFFSET
get SIZE asize
math SIZE -= OFFSET
set NAME ""
callfunction PCM 1
# extracts the contents of *.hog archives from
# 25 to Life (Xbox)
# (c) 2012-04-18 by AlphaTwentyThree of XeNTaX
get IDENT long
if IDENT != 0x20001
cleanexit
endif
get INFO long
goto 0x10
get FILES long
goto INFO
for i = 1 <= FILES
get NAMEPOS long
get OFFSET long
get SIZE long
get DUMMY long
savepos MYOFF
goto NAMEPOS
get NAME string
goto MYOFF
log NAME OFFSET SIZE
next i
# extracts the StreamingSounds.asrBE from Sniper Elite V2 (Xbox 360)
# (c) 2012-05-01 by AlphaTwentyThree of XeNTaX
idstring "Asura STSA"
endian big
get FSIZE long
get UNK long
get ZERO long
get FILES long
get DUMMY byte
goto 0x1d
for i = 1 <= FILES
get NAME string
if i != FILES
FindLoc NXT string "sounds" 0 ""
else
FindLoc NXT string "RIFF" 0 ""
endif
math NXT -= 8
goto NXT
get SIZE long
get OFFSET long
log NAME OFFSET SIZE
next i