Join also our Discord channel! Click here.

The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
GenericRipper
advanced
Posts: 53
Joined: Sun Mar 21, 2010 5:41 pm
Has thanked: 47 times
Been thanked: 4 times

The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

Post by GenericRipper » Sun Oct 20, 2019 6:49 pm

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!

ponaromixxx
beginner
Posts: 26
Joined: Thu Jul 17, 2014 4:52 am
Has thanked: 1 time
Been thanked: 10 times

Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

Post by ponaromixxx » Mon Oct 21, 2019 4:08 am

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

GenericRipper
advanced
Posts: 53
Joined: Sun Mar 21, 2010 5:41 pm
Has thanked: 47 times
Been thanked: 4 times

Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

Post by GenericRipper » Mon Oct 21, 2019 7:39 pm

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!

ponaromixxx
beginner
Posts: 26
Joined: Thu Jul 17, 2014 4:52 am
Has thanked: 1 time
Been thanked: 10 times

Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

Post by ponaromixxx » Tue Oct 22, 2019 3:41 am

Need a whole file Saboteur_338.bnk for analysis

ponaromixxx
beginner
Posts: 26
Joined: Thu Jul 17, 2014 4:52 am
Has thanked: 1 time
Been thanked: 10 times

Re: The Saboteur (Xbox 360) nonstandard Wwise *.pck ("PCK1" identifier)

Post by ponaromixxx » Tue Oct 22, 2019 3:59 am

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

Post Reply