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.

Broken Age .tex files

Featured Replies

  • Author
  • Localization

MerlinSVK, posted Fri May 01, 2015 7:55 pm (4967)


TEX to DDS

Code:
# Game: Broken Age (PC)
# TEX to DDS converter
# by MerlinSVK    May 2015
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

get NAME basename
string DNAME = NAME
string DNAME = ".dds"
string HNAME = NAME
string HNAME = ".head"

log HNAME 0 0x20         # save header separately

comtype deflate
IDstring "TEX "
get WIDTH short
get HEIGHT short
get MIPS byte
get TYPE byte      # 0x03 = DXT1, 0x05 = DXT5
get PAD short      # some padding marker or what

if MIPS > 0x01
 math WIDTH / 2
 math HEIGHT / 2
endif

if TYPE == 0x03
 set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\xDD\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
elif TYPE == 0x05
 set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\xDD\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
endif

if PAD == 0x00
 goto 0x14
 get ZSIZE long
 get SIZE long
else PAD == 0x02
 get ZSIZE long
 get SIZE long
endif

putVarChr MEMORY_FILE 0XC HEIGHT long
putVarChr MEMORY_FILE 0x10 WIDTH long
putVarChr MEMORY_FILE 0x14 SIZE long
putVarChr MEMORY_FILE 0x1C MIPS byte

append
 clog MEMORY_FILE 0x20 ZSIZE SIZE
append

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE



DDS to TEX

Code:
# Game: Broken Age (PC)
# DDS to TEX converter
# by MerlinSVK    May 2015
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

open FDDE DDS 0
open FDDE HEAD 1

get NAME basename
string NAME = ".tex_NEW"

get DSIZE asize 0
math DSIZE -= 0x80
get HSIZE asize 1

math FINAL_SIZE = HSIZE DSIZE
putvarchr MEMORY_FILE FINAL_SIZE 0
log MEMORY_FILE 0 0

log MEMORY_FILE 0 HSIZE 1      # copy header into memory_file
comtype deflate_compress
append
 clog MEMORY_FILE 0x80 DSIZE DSIZE 0   # append texture data
append

get ZSIZE asize MEMORY_FILE
math ZSIZE -= HSIZE

goto 0x0A 1
get PAD short 1
if PAD == 0x00
 putvarchr MEMORY_FILE 0x14 ZSIZE long
elif PAD == 0x02
 putvarchr MEMORY_FILE 0x0C ZSIZE long
endif

get TEXSIZE asize MEMORY_FILE
log NAME 0 TEXSIZE MEMORY_FILE


I don't have this game so I could't test if it works with the "_new" textures.
  • Author
  • Localization

aluigi, posted Sun May 03, 2015 1:43 pm (5008)


The format is a bit more complex with two parts of dds file and data that can be also non-compressed:
Code:
# Game: Broken Age (PC)
# TEX to DDS converter
# by MerlinSVK    May 2015
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

get NAME basename
set DNAME string NAME   # necessary for filenames that starts with numbers
string DNAME = ".dds"
set HNAME string NAME
string HNAME = ".head"

comtype deflate
IDstring "TEX "
get WIDTH short
get HEIGHT short
get MIPS byte
get TYPE byte      # 0x03 = DXT1, 0x05 = DXT5
get PAD short      # some padding marker or what

if MIPS > 0x01
 math WIDTH / 2
 math HEIGHT / 2
endif

if TYPE == 0x03
 set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\xDD\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
elif TYPE == 0x05
 set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\xDD\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
endif

math FULL_SIZE = 0
math FILES = 2      # needs to be improved?
#if PAD == 2
#    math FILES = 1
#endif
savepos OFFSET
xmath OFFSET "OFFSET (FILES * (4 4)) 4"
log HNAME 0 OFFSET         # save header separately

append
for i = 0 < FILES
    get ZSIZE long
    get SIZE long

    if SIZE == ZSIZE
        log MEMORY_FILE OFFSET SIZE
    else
        clog MEMORY_FILE OFFSET ZSIZE SIZE
    endif

    math OFFSET ZSIZE
    math FULL_SIZE SIZE
next i
append

putVarChr MEMORY_FILE 0XC HEIGHT long
putVarChr MEMORY_FILE 0x10 WIDTH long
putVarChr MEMORY_FILE 0x14 FULL_SIZE long
putVarChr MEMORY_FILE 0x1C MIPS byte

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE
  • Author
  • Localization

aluigi, posted Sun May 03, 2015 1:44 pm (5009)


Or alternatively it's enough to fix the OFFSET value in the original script to match the first or second part of data (0x20 first_ZSIZE)
  • Author
  • Localization

MerlinSVK, posted Sun May 03, 2015 2:10 pm (5012)


Thanks Luigi :)
  • Author
  • Localization

makc_ar, posted Sun May 03, 2015 3:42 pm (5017)


Thx aluigi
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.