ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Aug 03, 2020 11:47 am

All times are UTC




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Mark of the Ninja *.tex
PostPosted: Wed Jan 14, 2015 8:09 am 

Joined: Mon Oct 06, 2014 3:30 am
Posts: 215
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:
Attachment:
texture.rar [48.35 KiB]
Downloaded 82 times


Top
   
PostPosted: Wed Jan 14, 2015 10:58 am 

Joined: Wed Aug 13, 2014 10:00 am
Posts: 164
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


Top
   
PostPosted: Wed Jan 14, 2015 11:14 am 

Joined: Mon Oct 06, 2014 3:30 am
Posts: 215
Thanks! Working great!


Top
   
PostPosted: Thu Jan 15, 2015 12:40 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
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.


Top
   
PostPosted: Thu Jan 15, 2015 1:03 am 

Joined: Mon Oct 06, 2014 3:30 am
Posts: 215
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.


Top
   
PostPosted: Thu Jan 15, 2015 5:11 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
Is the following the official updated modding tool?
https://github.com/kleientertainment/ds_mod_tools

Last commit is 3 days ago so it's updated for sure :)
No binary included so you have to compile it.


Top
   
PostPosted: Thu May 05, 2016 7:23 am 

Joined: Mon Oct 06, 2014 3:30 am
Posts: 215
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!


Attachments:
fonts.rar [40.97 KiB]
Downloaded 53 times
Top
   
PostPosted: Thu May 05, 2016 7:19 pm 

Joined: Wed Aug 13, 2014 10:00 am
Posts: 164
I can't. I don't know what is the correct texture format. TextureFinder shows nothing usefull.


Top
   
PostPosted: Sat May 07, 2016 9:28 am 

Joined: Mon Oct 06, 2014 3:30 am
Posts: 215
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:
Attachment:
courier_0.rar [1.79 KiB]
Downloaded 60 times

Maybe Xbox 360 is different.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited