Page 1 of 2

Turok Evolution .TRE archives

Posted: Thu Nov 19, 2009 12:04 am
by AlphaTwentyThree
Hello to all of you!

This is my first post and, well, simultaneously a call for help. Why I haven't posted earlier? Well, there was some problem with my registration and I never investigated the causes. ;) Luckily some admin activated my account - Thanks to whoever did that! :)
I'm quite active in the VGM ripping scene and recently got a request for Turok: Evolution. All files but the videos are inside a TRE archive (at least in the XBox and GameCube version). I've never seen a similar HEX structure (file and folder tables among the single files) and so far I couldn't find any extractor. I've tried DragonUnpacker, Multi EX commander, GameExtractor - all without luck.
Does anyone know a program that is capable to extract the files?
Thanks a lot guys! :)

Regards, Timo

Re: Turok Evolution .TRE archives

Posted: Thu Nov 19, 2009 12:19 am
by Caboose
I don't know of an extractor, but maybe you could post an archive and someone could write a BMS script.

Re: Turok Evolution .TRE archives

Posted: Thu Nov 19, 2009 9:24 am
by AlphaTwentyThree
The contents of this post was deleted because of possible forum rules violation.

Re: Turok Evolution .TRE archives

Posted: Thu Nov 19, 2009 6:07 pm
by GameZelda

Code: Select all

# Header
Get NUM_FILES long
Get UNK long

# Calculate data offset
Set OFF_FILE_DATA long NUM_FILES
Math OFF_FILE_DATA *= 16
Math OFF_FILE_DATA += 4

For I = 0 < NUM_FILES
	# File info
	Get SIZE long
	Get UNK long
	Get UNK long
	Get UNK long

	# Extract file
	Log I OFF_FILE_DATA SIZE
	Math OFF_FILE_DATA += SIZE
Next I

Get FILE_SIZE asize
Print "OK. Final OFF_FILE_DATA = %OFF_FILE_DATA%, expected %FILE_SIZE%"

Re: Turok Evolution .TRE archives

Posted: Sun Nov 22, 2009 11:14 am
by AlphaTwentyThree
Thank you kindly for this script. However if I extract another TRE archive, it splits right in the middle of plain text lists. So maybe this TRE file is different than the others.
I've searched them a bit via HEX and found a kind of script in plain text inside the archive that seems to be used to extract its contents. At least is has a list with files, sizes and offsets, but the latter don't match to the container itself. When I get to it, I'll upload one of these other containers tomrrow earliest. Maybe the script it's imortable in MultiEx commander or GameExtractor.
Thanks! :)

Re: Turok Evolution .TRE archives

Posted: Wed Nov 25, 2009 12:12 pm
by AlphaTwentyThree
The contents of this post was deleted because of possible forum rules violation.

Re: Turok Evolution .TRE archives

Posted: Fri Nov 27, 2009 8:38 pm
by AlphaTwentyThree
The contents of this post was deleted because of possible forum rules violation.

Re: Turok Evolution .TRE archives

Posted: Sat Nov 28, 2009 12:06 am
by GameZelda
Fixed:

Code: Select all

# Header
Get NUM_FILES long

For I = 0 < NUM_FILES
   # File info
   Get OFFSET long
   Get SIZE long
   Get UNK long
   Get UNK long

   # Extract file
   Log I OFFSET SIZE
Next I
By the way, many of the extracted files are also like TRE files, so you can extract them with the same script!

There are also some WAVs.

Re: Turok Evolution .TRE archives

Posted: Sun Nov 29, 2009 7:07 pm
by AlphaTwentyThree
Hm, still not quite right: Extract the supertree0.tre and look at the first few files - they are still split in the middle.
Sorry to bother you...

Re: Turok Evolution .TRE archives

Posted: Fri Dec 04, 2009 7:55 pm
by AlphaTwentyThree
The contents of this post was deleted because of possible forum rules violation.

Re: Turok Evolution .TRE archives

Posted: Fri Dec 04, 2009 8:39 pm
by GameZelda
AlphaTwentyThree wrote:Hm, still not quite right: Extract the supertree0.tre and look at the first few files - they are still split in the middle.
Sorry to bother you...
I don't see any splitted file. Check if you're using the latest version of the script, and if it doesn't work, tell me the exact container & file no of the splitted file.
And what's wrong with the GC version?

Re: Turok Evolution .TRE archives

Posted: Sat Dec 05, 2009 1:56 am
by AlphaTwentyThree
GameZelda wrote:
AlphaTwentyThree wrote:Hm, still not quite right: Extract the supertree0.tre and look at the first few files - they are still split in the middle.
Sorry to bother you...
I don't see any splitted file. Check if you're using the latest version of the script, and if it doesn't work, tell me the exact container & file no of the splitted file.
And what's wrong with the GC version?
Oh I'm so sorry! :oops: I looked at the files once again and I saw that the files are not split but are single command files. I thought I saw some file list cut in the middle, but that's apparently not that case.
However, the GameCue version gives back the message "0 files found". Could be a slightly different header - maybe you can post another script for the GameCube version? Thanks! :)

Re: Turok Evolution .TRE archives

Posted: Mon Dec 07, 2009 5:29 am
by AlphaTwentyThree
Ok, figured it out after a while: The GameCube version just has a big endian header (n00by, I know...). So just add

Code: Select all

Endian big
to the above script and it works.
But can anyone tell me why the sequence

Code: Select all

Get NUM_FILES long
If NUM_FILES > 65536
   ReverseLong NUM_FILES
   Endian big
EndIf
doesn't work when added to the above script? Thanks ;)

Re: Turok Evolution .TRE archives

Posted: Mon Dec 07, 2009 10:49 pm
by evilpie
What doesnt work?
Why you want to do this, when you already changed it to big endians?
Post whole code..

Re: Turok Evolution .TRE archives

Posted: Tue Dec 08, 2009 9:44 am
by AlphaTwentyThree
I wanted to make it work for both archive formats. That' the code I tried:

Code: Select all

Get NUM_FILES long
If NUM_FILES > 65536
   ReverseLong NUM_FILES
   Endian big
EndIf

For I = 0 < NUM_FILES
   # File info
   Get OFFSET long
   Get SIZE long
   Get UNK long
   Get UNK long

   # Extract file
   Log I OFFSET SIZE
Next I
Message is always: 0 files found