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.

Mark of the Ninja *.tex

Featured Replies

  • Author
  • Localization

shadow_lonely, posted Wed Jan 14, 2015 8:09 am (2671)


Hi! Anyone can take and look this archive? Could you write a script to convert .tex to .png and comeback .tex? Here is some information, i found:
Quote:
first 4 bytes - KTEX.
next 4 bytes - ???
2 bytes - width
2 bytes - height


Image

Example file:
  • Author
  • Localization

MerlinSVK, posted Wed Jan 14, 2015 10:58 am (2679)


You can use scripts for Shank 2.

Code:
# Game: Shank 2 (PC)
# TEX to DDS converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\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\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"
get NAME basename
string DNAME = NAME
string DNAME = ".dds"
string KNAME = NAME
string KNAME = ".ktex"

get ASIZE asize
getdstring KTEX 0x8
get WIDTH short
get HEIGHT short
getDString UNK 0x6        # get that 6 unknown values
log KNAME 0xC 0x6         # save them to .ktex file

math DATASIZE = ASIZE
math DATASIZE -= 0x12     # 0x12 = size of KTEX header
savepos START

putVarChr MEMORY_FILE 0XC HEIGHT short
putVarChr MEMORY_FILE 0x10 WIDTH short

append
log MEMORY_FILE START DATASIZE
append

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE


and

Code:
# Game: Shank 2 (PC)
# DDS to TEX converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x4B\x54\x45\x58\x00\x00\x01\x02\xAA\xAA\xBB\xBB\xCC\xCC\xDD\xDD\xEE\xEE"

open FDDE DDS 0
open FDDE KTEX 1

get NAME basename
string NAME = NAME
string NAME = ".tex_NEW"

get ASIZE asize 0
goto 0xC 0
get HEIGHT short 0
get DUMMY short 0
get WIDTH short 0
goto 0x80 0

savepos START 0
math DATASIZE = ASIZE
math DATASIZE -= 0x80     # 0x80 = size of DDS header

putVarChr MEMORY_FILE 0x8 WIDTH short
putVarChr MEMORY_FILE 0xA HEIGHT short
# korekcia
set KOREKCIA short 0x0201
putVarChr MEMORY_FILE 0x6 KOREKCIA short
# korekcia

get UNK1 short 1
get UNK2 short 1
get UNK3 short 1

putVarChr MEMORY_FILE 0xC UNK1 short
putVarChr MEMORY_FILE 0xE UNK2 short
putVarChr MEMORY_FILE 0x10 UNK3 short


append
log MEMORY_FILE START DATASIZE
append


get TEXSIZE asize MEMORY_FILE
log NAME 0 TEXSIZE MEMORY_FILE
  • Author
  • Localization

shadow_lonely, posted Wed Jan 14, 2015 11:14 am (2681)


Thanks! Working great!
  • Author
  • Localization

puggsoy, posted Thu Jan 15, 2015 12:40 am (2690)


I'd just like to point out that this also works for Don't Starve. I think this format is used in most Klei Entertainment games.
  • Author
  • Localization

shadow_lonely, posted Thu Jan 15, 2015 1:03 am (2691)


puggsoy wrote:
I'd just like to point out that this also works for Don't Starve. I think this format is used in most Klei Entertainment games.


You can use Klei Textool, works for Don't Starve.
  • Author
  • Localization

shadow_lonely, posted Thu May 05, 2016 7:23 am (13109)


MerlinSVK wrote:
You can use scripts for Shank 2.

Code:
# Game: Shank 2 (PC)
# TEX to DDS converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\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\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"
get NAME basename
string DNAME = NAME
string DNAME = ".dds"
string KNAME = NAME
string KNAME = ".ktex"

get ASIZE asize
getdstring KTEX 0x8
get WIDTH short
get HEIGHT short
getDString UNK 0x6        # get that 6 unknown values
log KNAME 0xC 0x6         # save them to .ktex file

math DATASIZE = ASIZE
math DATASIZE -= 0x12     # 0x12 = size of KTEX header
savepos START

putVarChr MEMORY_FILE 0XC HEIGHT short
putVarChr MEMORY_FILE 0x10 WIDTH short

append
log MEMORY_FILE START DATASIZE
append

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE


and

Code:
# Game: Shank 2 (PC)
# DDS to TEX converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x4B\x54\x45\x58\x00\x00\x01\x02\xAA\xAA\xBB\xBB\xCC\xCC\xDD\xDD\xEE\xEE"

open FDDE DDS 0
open FDDE KTEX 1

get NAME basename
string NAME = NAME
string NAME = ".tex_NEW"

get ASIZE asize 0
goto 0xC 0
get HEIGHT short 0
get DUMMY short 0
get WIDTH short 0
goto 0x80 0

savepos START 0
math DATASIZE = ASIZE
math DATASIZE -= 0x80     # 0x80 = size of DDS header

putVarChr MEMORY_FILE 0x8 WIDTH short
putVarChr MEMORY_FILE 0xA HEIGHT short
# korekcia
set KOREKCIA short 0x0201
putVarChr MEMORY_FILE 0x6 KOREKCIA short
# korekcia

get UNK1 short 1
get UNK2 short 1
get UNK3 short 1

putVarChr MEMORY_FILE 0xC UNK1 short
putVarChr MEMORY_FILE 0xE UNK2 short
putVarChr MEMORY_FILE 0x10 UNK3 short


append
log MEMORY_FILE START DATASIZE
append


get TEXSIZE asize MEMORY_FILE
log NAME 0 TEXSIZE MEMORY_FILE


Hi! Could you update for Xbox360? Thanks!
  • Author
  • Localization

MerlinSVK, posted Thu May 05, 2016 7:19 pm (13142)


I can't. I don't know what is the correct texture format. TextureFinder shows nothing usefull.
  • Author
  • Localization

shadow_lonely, posted Sat May 07, 2016 9:28 am (13197)


MerlinSVK wrote:
I can't. I don't know what is the correct texture format. TextureFinder shows nothing usefull.

Thanks for your quick reply.
I think it is correct texture:
Maybe Xbox 360 is different.
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.