first 4 bytes - KTEX.
next 4 bytes - ???
2 bytes - width
2 bytes - height
Example file:
first 4 bytes - KTEX.
next 4 bytes - ???
2 bytes - width
2 bytes - height
Code: Select all
# 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
Code: Select all
# 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
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.
MerlinSVK wrote:You can use scripts for Shank 2.Code: Select all
# 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
andCode: Select all
# 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
MerlinSVK wrote:I can't. I don't know what is the correct texture format. TextureFinder shows nothing usefull.