Page 1 of 1

Trials Evolution *.pak

Posted: Sun Apr 29, 2012 11:28 pm
by Sectus
Has anyone looked into this? There's a bms script which can unpack the *.pak files for Trials 2 and Trials HD, but it doesn't work with this game. Looking at the files, it looks like the basic format is the same but maybe the compression scheme used is different.

Edit: Fiddling more with this, it seems many files in the archives don't actually have any compression.

If you use this bms script: http://aluigi.altervista.org/papers/bms/trials2.bms - and add "comtype copy" it'll successfully extract the archives and many files will be as intended. I dunno what compression is used for the compressed files though.

Re: Trials Evolution *.pak

Posted: Mon May 07, 2012 5:26 pm
by Kaisonic
Awesome find!

And for those music fanatics out there (like me), the music from Trials Evolution can be extracted from music.fsb using good-ole towav - just drag and drop music.fsb onto the towav executable and it'll spit out wav's of all the songs.

So to recap (sanity check):

1. Extract the *.pak files from the Trials Evolution Xbox 360 file using something like wxPirs
2. Open Luigi's Trials2 BMS script in Notepad and add a line with the text "comtype copy" (without quotes)
3. Use QuickBMS on the script you just edited and data.pak from Trials Evolution
4. Now to get the music, find music.fsb in the files extracted from data.pak (I think it's soundsystem/xbox/music.fsb)
5. Download towav (above), drag-and-drop music.fsb onto towav, and viola! Trials Evolution soundtrack.

Re: Trials Evolution *.pak

Posted: Mon May 07, 2012 5:45 pm
by aluigi
if you can send me via PM the link to where I can download one of the pak I will try to update the script

Re: Trials Evolution *.pak

Posted: Wed May 09, 2012 10:04 am
by aluigi

Re: Trials Evolution *.pak

Posted: Mon Mar 04, 2013 5:54 pm
by Teancum
Looks like the file format was updated again in Trials Evolution: Gold Edition. Three of the four files extract fine, but the main data.pak file fails. Here's the error, which may not be all that helpful to script writers. I should also note that if I manually rename that first file " pCΣ♀dC╪ÉWC╤─PC╔áHC┼xEC═êLC" I can get a valid Trials XML file, but the process stops after that. The table of contents is still in cleartext at the bottom of the file, and the header still shows xV4, which is the same version? that the other Trials Evolution .paks use.

Code: Select all

  offset   filesize   filename
------------------------------
  000149b0 2529       pCΣ♀dC╪ÉWC╤─PC╔áHC┼xEC═êLC▐

- it's not possible to create that file due to its filename or related
  incompatibilities (for example already exists a folder with that name), so
  now you must choose a new filename for saving it.
  if you press RETURN a new name will be generated automatically.
  - old: pCΣ♀dC╪ÉWC╤─PC╔áHC┼xEC═êLC▐
  - new: a

Error: incomplete input file number -1, can't read 25148 bytes.
       anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted


Press RETURN to quit
I should point out that RedLynx said a while back there *will* be a demo in the future. Dunno when, but if this isn't figured out before then I'll reply later on with a link to the demo. Thanks as always!

Re: Trials Evolution *.pak

Posted: Mon Mar 04, 2013 6:51 pm
by Haoose
Teancum, Use Offzip :wink:

Re: Trials Evolution *.pak

Posted: Tue Mar 05, 2013 1:26 am
by Teancum
It works -- that being said I lose all the filenames and directories. Here's Aluigi's script. I'm going to do my best to dive into the MexScript docs and try to see if I just need to fix an offset or something.

Code: Select all

# RedLynx Trials 2 Second Edition / HD (script 0.1.1)
# script for QuickBMS http://quickbms.aluigi.org

idstring "\x78\x56\x34\x12"
get OFFSET long
get FILES long
savepos INFO_OFF

math TMP = FILES
math TMP -= 1
math TMP *= 17
math TMP += INFO_OFF
goto TMP
    get DUMMY long
    get ZSIZE long
    get SIZE long
    get ZIP byte
    get OFFSET long
if ZIP == 0
    log MEMORY_FILE OFFSET SIZE
else
    clog MEMORY_FILE OFFSET ZSIZE SIZE
endif

get FILES long MEMORY_FILE
goto INFO_OFF
for i = 0 < FILES
    get DUMMY long
    get ZSIZE long
    get SIZE long
    get ZIP byte
    get OFFSET long
    get NAMESZ short MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE

    if ZIP == 0
        log NAME OFFSET SIZE
    elif ZIP == 4
        comtype xmemdecompress
        savepos TMP
        goto OFFSET
        get SIZE long
        get ZSIZE long
        savepos OFFSET
        clog NAME OFFSET ZSIZE SIZE
        goto TMP
    else
        comtype zlib
        clog NAME OFFSET ZSIZE SIZE
    endif
next i

Re: Trials Evolution *.pak

Posted: Wed Mar 06, 2013 1:50 pm
by aluigi
I have seen the pak but the names table is obfuscated in some way so I have updated the script to work on these archives but the files will be extracted without name.

Re: Trials Evolution *.pak

Posted: Thu Mar 07, 2013 12:48 am
by Teancum
Obfuscated how? I don't know much, but I know the names are in cleartext in the pak. Again, I don't know much, I just wasn't sure if you saw it.

**EDIT**

Do the files extract in order? If so I can peacemeal the directories back together. The game can run content outside of the archives, so I plan to use some modified files but need to get the structure and names correct.

Re: Trials Evolution *.pak

Posted: Thu Mar 07, 2013 7:28 am
by Haoose
Teancum
http://yadi.sk/d/j34Q5u2W3-eXZ
Import 4 files in data.pak =)
Image
Trials Evolution Gold Edition Beta - Tools by Haoose.rar

Re: Trials Evolution *.pak

Posted: Thu Mar 07, 2013 4:57 pm
by Sartr0n
Did I need to understand that there's a way to unpack all the files from the .pak archives with properly names or nope?

And Hoose, what are your tools for?

I haven't downloaded them, because I'm browsing from my phone now.

Re: Trials Evolution *.pak

Posted: Thu Mar 07, 2013 8:42 pm
by Teancum
Haoose wrote:Teancum
http://yadi.sk/d/j34Q5u2W3-eXZ
Import 4 files in data.pak =)
Image
Trials Evolution Gold Edition Beta - Tools by Haoose.rar
I was hoping to do cross-functionality between the PC and 360 versions, thus why I want to extract the files. But this is great, too.

Re: Trials Evolution *.pak

Posted: Sat Mar 09, 2013 10:32 am
by aluigi
I have updated the script trying to auto guess the file entry where is located the namestable.
In fact, as Teancum noticed, it's not longer the last file to contain the names but I have found no other references regarding what of them does this job now so I simply try to compare the number of FILES+1 in it and the number of FILES in the archive... seems to work :)

http://aluigi.org/papers/bms/trials2.bms

Re: Trials Evolution *.pak

Posted: Sat Mar 09, 2013 4:52 pm
by Teancum
Seems to work perfectly! Thanks Aluigi!