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.
Zero Tolerance for Disrespect

Kingdom heroes extract pck files

Featured Replies

  • Localization

Hi everyone,

I’m hoping someone here might be able to help me extract the textures from this file. The main file is the .pck, but it also comes with two additional files, .dir and .tbl, so I’ve attached all three just in case they are needed.

I’ve also been investigating the format with the help of AI, and this is what I’ve managed to discover so far:

Good progress so far: I found the ZpakFileSystem class (the game’s custom file reader), located its vtable, and traced it to the readFile(dirPath, index) function. This appears to be the function that looks up an entry in the .dir table using a binary search over the records, and then calls another object to read/decompress the data from the .pck.

If anyone has experience with this kind of custom archive format, reverse engineering, or has any idea how these .pck / .dir / .tbl files are structured, I would really appreciate any help or suggestions on how to proceed.

My main goal is simply to extract the textures from the archive. Any help for an a script for quickbms or py?

Thanks a lot in advance for taking the time to look at this! Any help would be greatly appreciated. :)

pack_prog_res.rar

Solved by Hazza12555

  • Localization
  • Solution

The .pck is a ZIP file in disguise. However, two things were changed.

1. Every PK signature (50 4B) is written as OD (4F 44).
2. The zlib header byte 78 is written as 02

Plus one structural change: local file headers are omitted entirely.
Entry offsets point straight at the raw deflate payload.

The .dir and .tbl files are redundant lookup caches.

Use the script attached to extract everything/or just the textures.

python zpak_extract.py pack_prog_res.pck # extract everything

python zpak_extract.py pack_prog_res.pck -o out --verify # + check every CRC

python zpak_extract.py pack_prog_res.pck --list # list, don't extract

python zpak_extract.py pack_prog_res.pck --textures # dds/tga/bmp/png/jpg only

zpak_extract.py

4 minutes ago, Hazza12555 said:

The .pck is a ZIP file in disguise. However, two things were changed.

1. Every PK signature (50 4B) is written as OD (4F 44).
2. The zlib header byte 78 is written as 02

Plus one structural change: local file headers are omitted entirely.
Entry offsets point straight at the raw deflate payload.

The .dir and .tbl files are redundant lookup caches.

Use the script attached to extract everything/or just the textures.

python zpak_extract.py pack_prog_res.pck # extract everything

python zpak_extract.py pack_prog_res.pck -o out --verify # + check every CRC

python zpak_extract.py pack_prog_res.pck --list # list, don't extract

python zpak_extract.py pack_prog_res.pck --textures # dds/tga/bmp/png/jpg only

zpak_extract.py

Good for you.

  • Author
  • Localization

Hi @Hazza12555 Thank you so much for your help! It worked perfectly and extracted all the textures without any errors! I hope you have a great day! You’re very smart! Best regards!

Create an account or sign in to comment

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.