Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Nameless32
Posts: 35
Joined: Sun Dec 21, 2014 7:43 pm

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by Nameless32 »

I believe that miracles are made, I believe u already has made some "miracles" with quickbms and scripts.

but I also understand that you are not omnipotent...
anyway. thank you for everything u have done so far.

but if find out a another method for this game.
a lot of people will be very happy :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by aluigi »

Let's try to convert the script to the second category, open the script with a text editor and replace the following:

Code: Select all

            putvarchr MEMORY_FILE TSIZE 0
            log MEMORY_FILE 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append
            log NAME 0 TSIZE MEMORY_FILE
with:

Code: Select all

            log NAME 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append

You don't need to reextract, just use it in reimport mode and let me know if it works (both reimporting and in-game)
Nameless32
Posts: 35
Joined: Sun Dec 21, 2014 7:43 pm

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by Nameless32 »

aluigi wrote:Let's try to convert the script to the second category, open the script with a text editor and replace the following:

Code: Select all

            putvarchr MEMORY_FILE TSIZE 0
            log MEMORY_FILE 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append
            log NAME 0 TSIZE MEMORY_FILE
with:

Code: Select all

            log NAME 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append

You don't need to reextract, just use it in reimport mode and let me know if it works (both reimporting and in-game)



Thank You Very much, now it's working reimport and in-game...
you made again a new " miracle " :D

\o/

# Tales of Xillia / Zestiria / Tales of the Abyss (script 0.1.1)
# script from Chrrox http://forum.xentax.com/viewtopic.php?p=59251#p59251
# updated and rewritten by aluigi
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension

string TMP p "FILEHEADER.%s" EXT
open FDSE TMP 0 EXISTS
if EXISTS == 0
string TMP p "FILEHEADER.%s" "TOFHDB"
open FDSE TMP 0
set EXT string "TLDAT"
endif

string TMP p "TLFILE.%s" EXT
open FDSE TMP 1

endian big

get DUMMY long # 0x9ae71c1a
get DUMMY long
get DUMMY long
get HASHES long
endian guess HASHES
get HASH_SIZE long
get ZERO long
get DUMMY long
get FILES long
get DUMMY_SIZE long
get ZERO long
for i = 0 < HASHES
get HASH_KEY long
get HASH_VALUE long
next i
for i = 0 < FILES
get SIZE longlong
get ZSIZE longlong
get OFFSET longlong
get HASH long
getdstring EXT 8
get DUMMY long

string NAME p= "%s/." EXT # autoguess

if ZSIZE == SIZE
log NAME OFFSET SIZE 1
else
endian save CURRENT_ENDIAN
endian little
goto OFFSET 1
get TLZC long 1
get TVER long 1
get TZSIZE long 1
get TSIZE long 1
if TVER == 0x0201 # Tales of the Abyss
comtype deflate
getdstring DUMMY 8 1
savepos OFFSET 1
clog NAME OFFSET TZSIZE TSIZE 1
else
comtype MSF # lzma_0
getdstring DUMMY 9 1
get CHUNK_SIZE long 1

xmath CHUNKS "TSIZE / CHUNK_SIZE"
xmath TMP "CHUNKS * CHUNK_SIZE"
if TMP != TSIZE
math CHUNKS + 1
endif
for x = 0 < CHUNKS
get CHUNK_ZSIZE short 1
putarray 0 x CHUNK_ZSIZE
next x
savepos OFFSET 1

log NAME 0 0
append
for x = 0 < CHUNKS
getarray CHUNK_ZSIZE 0 x
clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
math OFFSET + CHUNK_ZSIZE
next x
append

endif
if CURRENT_ENDIAN != 0
endian big
endif
endif
next i
Shinkun
Posts: 4
Joined: Wed Oct 21, 2015 8:38 am

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by Shinkun »

I'm assuming this works with the PC version?

Code: Select all


QuickBMS generic files extractor and reimporter 0.5.3 (64bit test)
by Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org

- GUI mode activated, remember that the tool works also from command-line
  where are available various options like folder scanning, filters and so on

- select the BMS script or plugin to use
- select the input archives/files to extract, type "" for whole folder and subfolders
- select the output folder where extracting the files
- open input file PK0\WIN\TLFILE.TLDAT
- open script G:\tales_of_xillia_zes.bms

Error: invalid endian value guess

Error: invalid endian value save

Error: invalid command "xmath" or arguments -1 at line 66

Press RETURN to quit


Nope. :/

Doesn't even seem to have the header...?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by aluigi »

Maybe you should not use a quickbms version released 4 years ago... maybe...
Shinkun
Posts: 4
Joined: Wed Oct 21, 2015 8:38 am

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by Shinkun »

=/ Well is it possible to get an updated version?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by aluigi »

http://quickbms.aluigi.org

Which is exactly the first result on Google when you search quickbms, and the website was written even in the quickbms header that you pasted.
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by shadow_lonely »

Nameless32 wrote:
aluigi wrote:Let's try to convert the script to the second category, open the script with a text editor and replace the following:

Code: Select all

            putvarchr MEMORY_FILE TSIZE 0
            log MEMORY_FILE 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append
            log NAME 0 TSIZE MEMORY_FILE
with:

Code: Select all

            log NAME 0 0
            append
            for x = 0 < CHUNKS
                getarray CHUNK_ZSIZE 0 x
                clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
                math OFFSET + CHUNK_ZSIZE
            next x
            append

You don't need to reextract, just use it in reimport mode and let me know if it works (both reimporting and in-game)



Thank You Very much, now it's working reimport and in-game...
you made again a new " miracle " :D

\o/

# Tales of Xillia / Zestiria / Tales of the Abyss (script 0.1.1)
# script from Chrrox http://forum.xentax.com/viewtopic.php?p=59251#p59251
# updated and rewritten by aluigi
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension

string TMP p "FILEHEADER.%s" EXT
open FDSE TMP 0 EXISTS
if EXISTS == 0
string TMP p "FILEHEADER.%s" "TOFHDB"
open FDSE TMP 0
set EXT string "TLDAT"
endif

string TMP p "TLFILE.%s" EXT
open FDSE TMP 1

endian big

get DUMMY long # 0x9ae71c1a
get DUMMY long
get DUMMY long
get HASHES long
endian guess HASHES
get HASH_SIZE long
get ZERO long
get DUMMY long
get FILES long
get DUMMY_SIZE long
get ZERO long
for i = 0 < HASHES
get HASH_KEY long
get HASH_VALUE long
next i
for i = 0 < FILES
get SIZE longlong
get ZSIZE longlong
get OFFSET longlong
get HASH long
getdstring EXT 8
get DUMMY long

string NAME p= "%s/." EXT # autoguess

if ZSIZE == SIZE
log NAME OFFSET SIZE 1
else
endian save CURRENT_ENDIAN
endian little
goto OFFSET 1
get TLZC long 1
get TVER long 1
get TZSIZE long 1
get TSIZE long 1
if TVER == 0x0201 # Tales of the Abyss
comtype deflate
getdstring DUMMY 8 1
savepos OFFSET 1
clog NAME OFFSET TZSIZE TSIZE 1
else
comtype MSF # lzma_0
getdstring DUMMY 9 1
get CHUNK_SIZE long 1

xmath CHUNKS "TSIZE / CHUNK_SIZE"
xmath TMP "CHUNKS * CHUNK_SIZE"
if TMP != TSIZE
math CHUNKS + 1
endif
for x = 0 < CHUNKS
get CHUNK_ZSIZE short 1
putarray 0 x CHUNK_ZSIZE
next x
savepos OFFSET 1

log NAME 0 0
append
for x = 0 < CHUNKS
getarray CHUNK_ZSIZE 0 x
clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE 1
math OFFSET + CHUNK_ZSIZE
next x
append

endif
if CURRENT_ENDIAN != 0
endian big
endif
endif
next i



Schedar wrote:
Hi guys!!! Im new in this comunity!! Well, I want tell us that I´m spanish, and Im sorry if my english is not very good.

OK, this post is for ask help of this community for can decrypt the audio files of this game for I can do the dubbed to spanish.

In this game exist 2 folders: PK0 and PK1. PK0 is the folder to japanese language, PK1 is to english language. Into de PK0 are the files (FILEHEADER.TOFHDB (10.270kb) and TLFILE.TLDAT (3,5gb.) ) I have succes of decrypt the "TLFILE.TLDAT" and I obtain a lot of folders, and between all of them only 2 folders have files that have a weight than I think if possible are the audios files, BUT all files are .DAT and I don´t encounter the way to obtain this audios in a habitual format.

Somebody can help me??

Thanks


i'm not sure, but i think, if in the " FILEHEADER.TOFHDB " you rename the entries of audio 1 to audio 2 and vice-versa ?
the game will read "audio 2" thinking he is the "audio 1".


But about text, do you know something? Thanks!
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Tales of Zestiria FILEHEADER.TOFHDB/TLFILE.TLDAT

Post by sigroon365 »

Hi, all. I just replace 'MEMORY_FILE' to 'i' and then I am able to reimport several files, however there are some problems. After reimporting, the ZSIZE of the files are smaller than the original files. As a result, when the game reads the files it causes error. Is there a way to solve this problems? Is it right to use 'comtype MSF'...?

I tried to use my tricky method for reimporting but it doesn't solve the above problems.