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.

image.bin (fpk) & LZO-compressed fpk | Drakengard / Drag-On Dragoon (PS2) (SOLVED)

Featured Replies

  • Author
  • Localization

swosho, posted Sun Apr 25, 2021 4:57 am (63554)


The game's data is stored in .bin archives with "fpk" magic. Here's how the main archive, image.bin, looks like:
Image
From what I gather:
0x08 - amount of files
0x0C - block/sector size
0x18 - TOC length?
0x28 - header size
0x2C - body size
0x40 - archive name
TOC:
0xA0 - null
0xA4 - offset (with the header size subtracted)
0xA8 - size
0xAC - uncompressed size / null if not compressed
...
If this may be important, in every other fpk archive the TOC starts at 0x80, and 0xXC value indicates the file type instead of uncompressed size.

So I used this caveman-made script to dump the contents of image.bin:
Code:
goto 0xA0
for i = 0    get DUMMY long
   get OFFSET long
   math OFFSET 0x4800
   get SIZE long
   get DUMMY long
   log "" OFFSET SIZE
next i

However, the majority of fpk archives contained there are compressed like so:
Image Image
Which seems to be LZO(1x?) algorithm some sort of 0x2D-long header (contains: 0x08 - size, 0x0C - csize), but I didn't get a match after manually trying to decompress them
both headered and with the header stripped, and comtype_scan2 gets stuck on these files without the ability to Ctrl C & N circumvent the hang-up.
Edit: Managed to run comtype_scan all the way through and it didn't result in compression algorithm matches.

If anyone could look into making a script for handling the archive or even tackling the compression alone, I would be eternally grateful. Thank you for your time, and sorry for the bother as always.

Here's a couple of compressed and uncompressed fpk samples and a full image.bin (919 MB) just in case.
  • Author
  • Localization

chrrox, posted Sun Apr 25, 2021 10:58 am (63558)


When doing compscan bat file kill quickbms.exe in task manager to have it continue if it hangs.
  • Author
  • Localization

swosho, posted Sun Apr 25, 2021 12:12 pm (63561)


Thanks, following your advice and also refraining from setting the expected size at the end of the command let the process go though all the algorithms!
Unfortunately, there were no decompressed matches. I tried utilising both the untouched compressed FPKs and the ones with the headers stripped.
  • Author
  • Localization

DKDave, posted Sun Apr 25, 2021 2:21 pm (63564)


Try this script to decompress the files. It does use lz01x - the compressed files are split up into various parts, rather than being 1 compressed section.

My script will extract and decompress all of the files in image.bin. Among the extracted files are many other fpk files. The format of these seems to be just slightly different to the main fpk file table. The extracted files might need to be split further into more sub-files.

  • Author
  • Localization

swosho, posted Sun Apr 25, 2021 3:37 pm (63565)


It works brilliantly! Thank you so much, DKDave!
  • Author
  • Localization

swosho, posted Tue May 11, 2021 7:08 am (63882)


It turns out the data inside the archives containing the FMV subtitles is also compressed but with a different algorithm:
Image Image
Could these be decompressed? Sorry for the bother and thanks again for your time.
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.