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.

Fable 2 .bnk header compressed with zlib *SOLVED*

Featured Replies

  • Author
  • Localization

IDontKnowMuch, posted Sat Apr 13, 2019 5:13 pm (46888)


Getting straight to the point i want my bms script to decompress the header of an archive, read the offsets and filelengths from the header, then go back to the archive and extract the files.

Does anyone know how to do this? I've tried and can't get very far because for some reason QuickBMS is telling me that "the compressed zlib/deflate input is wrong or incomplete". I just can't figure out what i'm doing wrong even though i'm supplying the correct values to the CLOG function. Once i've figured out how to extract the header and decompress it then i should be alright on my own from there.

Here's my script so far:
-----------------------------------------------------------------------------------------------

ENDIAN BIG #Archive and header are big endian

GET BASEOFFSET LONG #Always 8000(in hex) in every file with some exceptions of a file having a big header.
GET UNKNOWN LONG #Is always 3 in every file
GET NULL BYTE #I do this to adjust the current offset by one byte
GET ZSIZE LONG #The size of the header while compressed. Take note that this is a single byte.
GET SIZE LONG #The size of the header while decompressed
SAVEPOS OFFSET #The compressed header starts here, always at \x11 in every file
COMTYPE ZLIB #It is compressed with zlib but apparently i don't need to specify this
SET NAME STRING "HEADER" #Could have just used HEADER as an argument in clog but just in case...

CLOG NAME OFFSET ZSIZE SIZE
#With the sample file i've provided this should output a file named HEADER, which starts at the offset of \x11 with the compressed size of 266(hex) and a decompressed size of 53c


-----------------------------------------------------------------------------------------------
I've attached a sample file. Thanks in advance :) (Also if you write an entire extractor for this, the wav files are encoded in xna so use xnaencode to decode them)

Edit: Turns out there's an entire forum dedicated to modding Fable 2 that i somehow missed and they already have multiple bnk extractors. Oops.
  • Author
  • Localization

aluigi, posted Sat Apr 13, 2019 9:35 pm (46896)


IDontKnowMuch wrote:
Edit: Turns out there's an entire forum dedicated to modding Fable 2 that i somehow missed and they already have multiple bnk extractors. Oops.

:D
  • Author
  • Localization

IDontKnowMuch, posted Sun Apr 14, 2019 1:50 pm (46928)


The tools i tried were kind of half functional so i decided to write a full bms script for it. It works for every file but two which have the headers split up, compressed, and spread around the end of the files but it's not really a problem because i can use a wavescan script to just extract them without file names.
Also the only reason i managed to make the script was because i saw a reply you made in a xentax thread about the zlib data being not properly compressed and to use zlib_noerror which solved the problem i was having with the decompression not working. So thanks!

I've also attached my complete script. It trims the first 4 bytes of the wav files so you can use xmaencode once they're extracted. Also the script does NOT work with speech.bnk and 1024mip0_textures.bnk due to the headers being messed up. If anyone really really wants to be able to extract these two files properly then i might update the script.

EDIT: For some reason chrome is saying the script is malicious even though it's literally readable plaintext.
Also you have to have the archive in the same folder as output. Sorry about that.

Fable2 bnk Complete.bms

  • Author
  • Localization

fignyafsyakaya, posted Tue Oct 04, 2022 8:10 pm (73676)


Tried to do smth with "speech.bnk" - this Frankenstein of a script extracted a table with filenames and offsets.

Now I attempt to find some ways to use it - it might be less difficult than this, but the bigger problem is, I do not seem to have enough experience to use it without its separate extraction from bnk-archive.
  • Author
  • Localization

fignyafsyakaya, posted Tue Oct 04, 2022 8:50 pm (73677)


Now, this script extracts xma-wavs without "xma "-s in the beginning, after that it's possible to decode them through vgmstream.

Of course, in order to work, both table and bnk-archive are supposed to be in the same folder, yep.
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.