Jump to content

Bayonetta Origins (NSW) pkzl - unknown compression


Go to solution Solved by AlphaTwentyThree,

Recommended Posts

  • Engineer

image.thumb.png.5f135b0badf259f719b2155d95ebcf88.png

The archive format itself is easy but I'm completely stuck at the compression. Tried comtype_scan with different offsets but no results. Files always start with 8 bytes of unknown data, then some 8 byte header identifier (screenshot is from a BXM file).

The file name list has an "OodleKraken" identifier so I thought it would just be oodle but that compression didn't bring any result either. I can provide more files if needed.

Thanks for your help!

Edit: added some pkz samples as well (source_pkz.7z).

pkz.7z

source_pkz.7z

Edited by AlphaTwentyThree
Link to comment
Share on other sites

Well i was unable to get over filenames since the logic is sooo stupid so filenames are dumped as offsets.

####################################
# Bayonetta Origins (NSW) - *.pkzl #
####################################
get BaseFileName basename
comtype oodle

idstring "pkzl"
getdstring Dummy 0x4
get FileSize uint32
getdstring Dummy 0x4
get Files uint32
get EntrySize uint32
get FileNameTableSize uint32

for i = 0 < Files
	getdstring Dummy 0xC
	get Size uint32
	getdstring Dummy 0x4
	get Offset uint32
	getdstring Dummy 0x4
	get ZSize uint32
	string Name p= "%s/%u.dat" BaseFileName Offset
	if ZSize != Size
		clog Name Offset ZSize Size
	else
		log Name Offset Size
	endif
next i

 

Link to comment
Share on other sites

  • Engineer
  • Solution
Posted (edited)

SOLVED

I just checked my script, turns out it was the exact same as yours, I already had the name retrieval implemented. Just tried it again without changing a thing and it suddenly works now?! Absolutely no idea why!

The great mysteries of coding I guess... Here's my original script, now suddenly working as it should:

# Bayonetta Origins: Cereza and the Lost Demon (NSW)
# *. pkz extractor
#
# (c) 2024-03-03 by AlphaTwentyThree of ResHax
# script for QuickBMS http://quickbms.aluigi.org

comtype oodle
idstring pkzl
get ZERO short
get VER short
get FSIZE longlong
get FILES long
get TOC long
goto TOC
xmath NAMEOFF "0x20 * FILES + TOC"
set SHIFT 0x10
for i = 1 <= FILES
	get NAMEPOS long
	math NAMEPOS += NAMEOFF
	get COMP long
	get SIZE longlong
	get OFFSET longlong
	get CSIZE longlong
	savepos MYOFF
	goto NAMEPOS
	get NAME string
	if SIZE != CSIZE
		clog NAME OFFSET CSIZE SIZE
	else
		log NAME OFFSET CSIZE
	endif
	goto MYOFF
next i

 

Edited by AlphaTwentyThree
Link to comment
Share on other sites

  • Engineer

And to round things off for that game, here's the script for the contained archive format:

# Bayonetta Origins: Cereza and the Lost Demon (NSW)
# Data extractor
# works with the following extensions: dat, dtt, eff, evn
#
# (c) 2024-03-03 by AlphaTwentyThree of ResHax
# script for QuickBMS http://quickbms.aluigi.org

get FOLDER basename

idstring "DAT\0"
get FILES long
get OFF_OFFSETS long
get OFF_TYPES long
get OFF_NAMES long
get OFF_SIZES long
get OFF_UNK long
goto OFF_NAMES
get NAMEL long
savepos OFF_NAMES

for i = 0 < FILES
	goto OFF_OFFSETS
	get OFFSET long
	savepos OFF_OFFSETS
	
	goto OFF_NAMES
	getDstring NAME NAMEL
	savepos OFF_NAMES
	
	goto OFF_SIZES
	get SIZE long
	savepos OFF_SIZES
	
	string NAME p= "%s/%s" FOLDER NAME
	log NAME OFFSET SIZE
next i

43,000+ files in the end, everything is pretty open for mining.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...