Page 1 of 1
The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)
Posted: Sun Oct 20, 2019 6:49 pm
by GenericRipper
Good day everyone, I'd highly appreciate any help with extracting banks & audio streams from
this (cuts from start and end of a *.pck file): it's probably a slight mutation of normal Wwise *.pck ("AKPK" identifier) but right now it makes it incompatible with scripts that usually work with such archives.
I found
this BMS but apparently it was made for another platform since my Saboteur.pck has different endian (that's why its identifier is "PCK1" instead of "1KCP").
Goodbye and thanks in advance!
Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)
Posted: Mon Oct 21, 2019 4:08 am
by ponaromixxx
bnk_scan.bms
Code: Select all
idstring "PCK1"
get FILE_SIZE asize
findloc OFFSET binary "BKHD"
math i = 1
for OFFSET = OFFSET < FILE_SIZE
goto OFFSET
get DUMMY long
findloc NEXT_OFFSET binary "BKHD" 0 ""
if NEXT_OFFSET == ""
get NEXT_OFFSET asize
endif
xmath SIZE "NEXT_OFFSET - OFFSET"
get NAME basename
string NAME += "_"
string NAME += i
string NAME += ".bnk"
log NAME OFFSET SIZE
math OFFSET = NEXT_OFFSET
next i
Wwise_extract_bnk.bms
Code: Select all
get BNAME basename
getDstring IDENT 4
if IDENT == "BKHD"
callfunction BKHD 1
else
print "Error: no valid Wwise bnk"
cleanexit
endif
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
Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)
Posted: Mon Oct 21, 2019 7:39 pm
by GenericRipper
It's much appreciated man, your script works nicely!
I wouldn't mind some help with properly extracting contents of
one of those *.bnk files though; it looks like there's a succession of many tracks after an actual bank (the one with "BKHD" identifier) here, that bank (Saboteur_338.bnk) is 433 МB but if I unpack it with Wwise_extract_bnk.bms I only get 784 КB worth of *.wem files. It'd be great if you helped me with proper extraction of Saboteur_338.bnk too!
Best regards & thank you once again!
Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)
Posted: Tue Oct 22, 2019 3:41 am
by ponaromixxx
Need a whole file Saboteur_338.bnk for analysis
Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)
Posted: Tue Oct 22, 2019 3:59 am
by ponaromixxx
wem-xma_scan.bms
Code: Select all
get FILE_SIZE asize
findloc OFFSET binary "\x52\x49\x46\x58"
math i = 1
for OFFSET = OFFSET < FILE_SIZE
goto OFFSET
get DUMMY long
findloc NEXT_OFFSET binary "\x52\x49\x46\x58" 0 ""
if NEXT_OFFSET == ""
get NEXT_OFFSET asize
endif
xmath SIZE "NEXT_OFFSET - OFFSET"
get NAME basename
string NAME += "_"
string NAME += i
string NAME += ".wem"
log NAME OFFSET SIZE
math OFFSET = NEXT_OFFSET
next i