XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun Sep 24, 2017 8:56 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Converting .gtf files
PostPosted: Fri Jul 21, 2017 2:10 pm 
Offline
ultra-n00b

Joined: Fri Jul 21, 2017 8:11 am
Posts: 4
Has thanked: 2 times
Have thanks: 0 time














You can make the ads go away by registering

Hey there, I have extracted some .gtf files and I need help converting into a readable format.

Here is some of the files in question: .GTFs

Here is the equivalent files from the PC version: .PNGs

I believe that they would be the same image as the file sizes of the .gtfs compare to the PC .pngs match up somewhat.


Last edited by Crykin on Sun Jul 23, 2017 2:29 am, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Converting .gtf files
PostPosted: Fri Jul 21, 2017 11:29 pm 
Offline
ultra-n00b

Joined: Fri Jul 21, 2017 8:11 am
Posts: 4
Has thanked: 2 times
Have thanks: 0 time
Update: I managed to convert one of the background pngs to a dds before using the tool on it. As you can see below the 2 files are very different. I'm not sure if this is because there is some other compression/encryption or something going on OR I'm on a wild goose chase :P

Extracted .gtf: Original
.gtf converted from .png: Converted


Last edited by Crykin on Sun Jul 23, 2017 2:30 am, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Converting Terraria PS3 .gtf files
PostPosted: Sat Jul 22, 2017 2:39 am 
Offline
VIP member
VIP member

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 868
Has thanked: 1853 times
Have thanks: 449 times
here is a bms script to extract the image from compressed gtf :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

comtype zlib_noerror
get GTF_SIZE asize
get NAME basename
string NAME + "_ext.gtf"
get TOTAL_UNCOMP_SIZE long
savepos TMP
get FIRST_OFFSET long
xmath NUM_BLOCKS "(FIRST_OFFSET - 4) / 4"
goto TMP
for i = 0 < NUM_BLOCKS
   get OFFSET long
   savepos TMP2
   get NEXT_OFFSET long
   if NEXT_OFFSET < 0
      xmath ZSIZE "GTF_SIZE - OFFSET"
   elif NEXT_OFFSET > GTF_SIZE
      xmath ZSIZE "GTF_SIZE - OFFSET"
   else
      xmath ZSIZE "NEXT_OFFSET - OFFSET"
   endif
   append
   clog NAME OFFSET ZSIZE ZSIZE
   append
   goto TMP2
next i


the extracted texture has a 128 byte big-endian header with width and height stored as shorts at 0x20 and 0x22

edit
here is a Noesis python script to open the extracted texture :D

supports dxt1

edit again :D
found some specs for gtf here
http://www.psdevwiki.com/ps3/Multimedia ... _Tools#GTF


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Last edited by AceWell on Sat Jul 22, 2017 6:28 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Converting .gtf files
PostPosted: Sat Jul 22, 2017 9:56 am 
Offline
ultra-n00b

Joined: Fri Jul 21, 2017 8:11 am
Posts: 4
Has thanked: 2 times
Have thanks: 0 time
Great work man! I actually don't need the Noesis script since the tool now works on the extracted gtf files :)

Just one more thing, when the gtf file has more than one texture in the script doesn't work. Here is a file: .gtf (multiple textures)


Last edited by Crykin on Sun Jul 23, 2017 2:32 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Converting Terraria PS3 .gtf files
PostPosted: Sat Jul 22, 2017 6:05 pm 
Offline
VIP member
VIP member

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 868
Has thanked: 1853 times
Have thanks: 449 times
ok i updated the bms script :D
you can also use offzip to extract the textures if need be
Code:
offzip -a -1 somename.gtf c:\offzip\extracted

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Converting Terraria PS3 .gtf files
PostPosted: Sat Jul 22, 2017 7:33 pm 
Offline
ultra-n00b

Joined: Fri Jul 21, 2017 8:11 am
Posts: 4
Has thanked: 2 times
Have thanks: 0 time
Success! You really know what you're doing, thanks very much for your time :mrgreen:


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: philgrf and 2 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group