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.

BattleBlock Theater (PC)

Featured Replies

  • Author
  • Localization

puggsoy, posted Wed Dec 17, 2014 2:29 am (2181)


The only files that seem to contain any kind of graphical data are the .baf files in GameData\AnimFiles. Looking at them through graphic viewers such as TiledGGD and TextureFinder simply shows static, so they might be compressed somehow. They also likely contain some sort of frame information in addition to the graphics.

I've attached some zipped up sample files.
  • Author
  • Localization

MerlinSVK, posted Wed Dec 17, 2014 2:01 pm (2184)


It's compressed by Zlib.

decompression

Code:
comtype zlib
get NAME filename
string NAME = ".dat"
get ZSIZE asize
math ZSIZE -= 4
get SIZE long
clog NAME 4 ZSIZE SIZE


compression

Code:
get SIZE asize
log MEMORY_FILE 0 0
putvarchr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0
get NAME filename
string NAME = ".new"
putvarchr MEMORY_FILE 0 SIZE long
math SIZE -= 4
comtype zlib_compress
append
clog MEMORY_FILE 4 SIZE SIZE
append
get MSIZE asize MEMORY_FILE
log NAME 0 MSIZE MEMORY_FILE


Decompressed files are DDS textures with some added data on the begining.
  • Author
  • Localization

puggsoy, posted Thu Dec 18, 2014 1:06 am (2201)


Oh wow, that's simple! Guess I should always try zlib when something looks compressed. Thank you!

Been looking some more into it, most of the data above the DDS files looks like animation data, which I don't really need. However I have managed to find a number of things:

  • At 0x00 is the number of DDS files (short)
  • At 0x04 is the number of animations (short)
  • At 0x50 is the first DDS length, followed by its offset (long). After this it repeats every 0x30 bytes (i.e. the following length offset pairs are at 0x88, then 0xC0, and so on) for the number of DDS files.

I don't need the animation number but I noticed it anyway. The rest of the data doesn't seem relevant to extraction, but I would be interested nonetheless if anybody does manage to figure any of it out.

In any case, made a script to extract the DDS files:
Code:
# BattleBlock Theater .baf format
#
# Written by puggsoy and MerlinSVK
# script for QuickBMS http://quickbms.aluigi.org

comtype zlib
get ZSIZE asize
math ZSIZE -= 4
get SIZE long
clog MEMORY_FILE 4 ZSIZE SIZE

get FILENUM short MEMORY_FILE

goto 0x50 MEMORY_FILE

for i = 1 <= FILENUM
   get SIZE long MEMORY_FILE
   get OFFSET long MEMORY_FILE
   get NAME filename
   set NUM string i
   string NAME -= 4
   string NAME = _
   string NAME = NUM
   string NAME = .dds
   
   log NAME OFFSET SIZE MEMORY_FILE
   
   goto 0x30 MEMORY_FILE SEEK_CUR
next i
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.