Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Astral Chain package

Featured Replies

  • Author
  • Localization

Demonslayerx8, posted Wed Aug 28, 2019 11:55 am (50469)


I've got the container pretty much all figured out, but I have 0 clue on how to make a script, so I've uploaded some samples from the game for anyone to make a BMS script for

Quote:
0x00 - magic [pkzl]
0x04 - unk
0x08 - package size
0x10 - files in package
0x14 - table offset location
0x18 - length of filename table

table:
-Filename Location (at ZStandard)
-Decompressed Size [this can be skipped]
-Offset location of said compressed file
-Compressed file length


No need to extract files to their decompressed files since it's all zstandard/zstd compression, I can just decompress them via smash ultimate tools, which is what I did for the model, when I was extracting files 1 at a time without proper filenames.
Image
  • Author
  • Localization

yham, posted Wed Aug 28, 2019 1:52 pm (50471)


I want to extract text file. But I'm noob...I'm waiting for completion of BMS script or another tool.
  • Author
  • Localization

Demonslayerx8, posted Wed Aug 28, 2019 2:26 pm (50472)


yham wrote:
I want to extract text file. But I'm noob...I'm waiting for completion of BMS script or another tool.

the text file has 90 compressed files within it, and also compressed with zstd.
  • Author
  • Localization

yham, posted Wed Aug 28, 2019 5:36 pm (50475)


Demonslayerx8 wrote:
yham wrote:
I want to extract text file. But I'm noob...I'm waiting for completion of BMS script or another tool.

the text file has 90 compressed files within it, and also compressed with zstd.

Thank you for advice. But I am realy noob. I can only search or double-click. XD
And I can wait patiently.
  • Author
  • Localization

masagrator, posted Wed Aug 28, 2019 8:18 pm (50476)


My first script. I can't get it to work with names, so for now temporary solution. It's decompressing files.
Code:
comtype zstd
idstring "pkzl"
get UNKN long
get archiveSize longlong
get filecount long
get TABLE_OFFSET long
get NAME_TABLE long
set NAME ""
GoTo TABLE_OFFSET
for x = 0 < filecount
    get NAME_OFFSET longlong
   GET SIZE longlong
   GET OFFSET longlong
   GET ZSIZE longlong
    clog NAME OFFSET ZSIZE SIZE
   set NAME ""
next x


and here is for files with idstring "DAT" - also without correct filenames
Code:
idstring "\x44\x41\x54\x00"
get filecount long
get TABLE_OFFSET long
GET FILE_FORMAT_TABLE long
GET FILENAMES_OFFSET long
set NAME ""
GoTo TABLE_OFFSET
get SIZE_LAST_FILE asize
for x = 1 < filecount
   get offset long
   get size long
   math size - offset
   log NAME offset size
   set NAME ""
   math TABLE_OFFSET 4
   GOTO TABLE_OFFSET
next x
get offset long
math SIZE_LAST_FILE - offset
set NAME ""
log NAME offset SIZE_LAST_FILE
  • Author
  • Localization

Demonslayerx8, posted Wed Aug 28, 2019 10:56 pm (50477)


oh nice, wasn't expecting a decompress script to be made too, but rip filenames and extensions... :/

edit:
ok apparently it's not a name table.. just string names lol
  • Author
  • Localization

yham, posted Thu Aug 29, 2019 5:03 am (50481)


I tested the script and some went well.
But Text.pkz became 90 .ptd files.
I tried decompress with ztsd but it didn't work...
  • Author
  • Localization

masagrator, posted Thu Aug 29, 2019 7:52 am (50484)


First script is only for pkz files.

I looked at PTD and table looks too complicated for me to understand what's going on.
File has three sections: table, unknown data (encrypted/compressed filenames?) and file data with some info before block. And they are twice, one after another.

I can only assume that beginning is
Code:
magic "PTD\x00"
dummy longlong
textscount long
table_offset long
unknown long
data_offset long


Table contains 4 informations
Code:
unknown long
unknown2 long
unknown3 long
unknown4 long


Only second looks like it's offset (it's jumping to offset which is summary of unknown2 offset of unknown) to some unreadable data.
First one may be offset for RAM (though I don't know what is base offset to confirm it with exefs)

So this looks like it's not for unpacking, but this is proper file. So some tool needs to be done for reading it.

If someone want to look at it
(Here you have script for renaming to correct filenames for text.pkz files - https://pastebin.com/huqXr5rz
ui.pkz files - https://pastebin.com/hsPzKuJs )
  • Author
  • Localization

yham, posted Thu Aug 29, 2019 11:23 am (50487)


>need tools.
If we find text like hidden weapons or items, I think it's worth.
But if not easy...
Anyway, thank you for the script!
  • Author
  • Localization

Demonslayerx8, posted Fri Aug 30, 2019 10:33 pm (50512)


Someone over at Xentax made a proper script, so enjoy. It exports files with their proper names, and also decompresses the files also.

Quote:
# Astral Chain . pkz extract
# By Dave, 2019

IDString "pkzl"

ComType ZSTD

Goto 0x10
Get ITEMS Long
Get FILE_ENTRY Long

XMath NAME_TABLE "FILE_ENTRY (ITEMS * 0x20)"

For A = 1 to ITEMS

Goto FILE_ENTRY
Get NAME_OFFSET Long
Get JUNK Long
Get SIZE Long
Get JUNK Long
Get OFFSET Long
Get JUNK Long
Get ZSIZE Long
Math NAME_OFFSET NAME_TABLE
Goto NAME_OFFSET
GetDSTring FILENAME 0x10

Clog FILENAME OFFSET ZSIZE SIZE
# Log FILENAME OFFSET ZSIZE # Use this line to get compressed output instead

Math FILE_ENTRY 0x20

Next A
  • Author
  • Localization

lisomn, posted Sun Sep 01, 2019 11:18 pm (50546)


masagrator wrote:
First script is only for pkz files.

I looked at PTD and table looks too complicated for me to understand what's going on.
File has three sections: table, unknown data (encrypted/compressed filenames?) and file data with some info before block. And they are twice, one after another.

I can only assume that beginning is
Code:
magic "PTD\x00"
dummy longlong
textscount long
table_offset long
unknown long
data_offset long


Table contains 4 informations
Code:
unknown long
unknown2 long
unknown3 long
unknown4 long


Only second looks like it's offset (it's jumping to offset which is summary of unknown2 offset of unknown) to some unreadable data.
First one may be offset for RAM (though I don't know what is base offset to confirm it with exefs)

So this looks like it's not for unpacking, but this is proper file. So some tool needs to be done for reading it.

If someone want to look at it
(Here you have script for renaming to correct filenames for text.pkz files - https://pastebin.com/huqXr5rz
ui.pkz files - https://pastebin.com/hsPzKuJs )

Table contains 4 informations
Code:
unknown1 long
block_Offset long(Need add table_offset)
block_Original_size long
block_in_file_size long
  • Author
  • Localization

Kerilk, posted Sun Sep 22, 2019 10:06 pm (50851)


I have looked a bit at astral chain text files (now that the Noesis plugin supports textures), here are some binary templates:
- for PTD files: https://github.com/Kerilk/bayonetta_too ... n ptd.bt
- for ktb font files: https://github.com/Kerilk/bayonetta_too ... n ktb.bt

ftb files are also used, they seem to determine glyphs position on the texture but I have yet to understand how it works.

From my point of view, the format is pretty similar to bayo 2 but without the name of the code points which made bayonetta/bayo 2 text format easy to read. See discussion here: https://github.com/Kerilk/bayonetta_tools/issues/4
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.