Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
lionheartuk
Posts: 28
Joined: Mon Jan 26, 2015 8:39 pm

Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by lionheartuk »

Hey Guys.

Much like the previous Tales games, Zestiria uses 2 folders for its textures the first, TOTEXB_D are uncompressed 1kb files and rather bluntly point at what they want from the other file.

Example:
TOTEXB_D
Image
Simply points to the TOTEXP_P that contains the data it wants, not entirely sure how it knows which TOTEXP_P contains that data though.

The TOTEXP_P file is TLZC compressed, but there is this QuickBMS script to extract it:

Code: Select all

idstring "TLZC"
get name basename
string name + ".FPS4"
comtype MSF
get version long
get tzsize long
get tsize long
goto 0x1D
set blockcount tsize
math blockcount += 0xFFFF
math blockcount /= 0x10000
for i = 0 < blockcount
get zsize short
putarray 0 i zsize
next i
for i = 0 < blockcount
savepos offset
getarray ZSIZE 0 i
if tsize >= 0x10000
append
clog MEMORY_FILE OFFSET ZSIZE 0x10000
append
else
append
if ZSIZE == 0
log MEMORY_FILE OFFSET tsize
else
clog MEMORY_FILE OFFSET ZSIZE tsize
endif
append
endif
math tsize -= 0x10000
math offset + ZSIZE
goto offset
next i
get SIZE asize MEMORY_FILE
log name 0 SIZE MEMORY_FILE


This outputs the following .fps4 file: https://dl.dropboxusercontent.com/u/779 ... EXP_P.FPS4

However that file is either compressed or encrypted, I don't understand it at all. I'm not any good with QuickBMS scripts, but this file seems to have no header whatsoever, I can't gather anything whatsoever from looking at it.

Incase its possible that the file has been extracted incorrectly from the TOTEXP_P archive, I've provided both the TOTEXB_D and the TOTEXP_P file for anyone who's interested to take a look at here
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by aluigi »

I think that the extraction is ok, the file looks like a texture without header and it's not encrypted.
I'm not good with graphics files so this is the max I can say about it.
lionheartuk
Posts: 28
Joined: Mon Jan 26, 2015 8:39 pm

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by lionheartuk »

Thanks for the information Aluigi, I'll keep looking and see if I get any further.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by sigroon365 »

It seems that the above script works on version 01 04 00 00 at 0x4.
This sample is version 01 02 00 00 at 0x4. And it is different from others.

Samples. https://www.sendspace.com/file/8bfkjp
Are these files also can be unpacked?
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by aluigi »

The script supports everything correctly but TLZC are the archived files and not the stand-alone ones.
Are you sure these 2 files weren't extracted from an archive?
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by sigroon365 »

aluigi wrote:The script supports everything correctly but TLZC are the archived files and not the stand-alone ones.
Are you sure these 2 files weren't extracted from an archive?


These files extracted from archive. And current script doesn't extract data from this file.
What 'not the stand-alone ones' means *.TOTEXB_D files like this samples?
https://www.sendspace.com/file/0d0ftb
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by sigroon365 »

Another different version of tlzc files can be unpacked by the above script.
https://www.sendspace.com/file/3pa4g7

Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by aluigi »

I don't understand.
The script 0.1.2a already supports archives containing TLZC files of various versions, so what's the problem?

Probably you are using an old version of the script if you have extracted files with the TLZC header.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by aluigi »

Ah you are using the script in the first post, right?
This is the correct script:
http://aluigi.org/bms/tales_of_xillia.bms
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Tales of Zestiria TOTEXB_D and TOTEXP_P archives

Post by sigroon365 »

Ah, I used old script. :lol: Thank you!