F1 Race Stars (_toc.bundle)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

F1 Race Stars (_toc.bundle)

Post by aluigi »

AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

One question though:
Can this also work on the X360 and PS3 versions of the game?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

I don't know because I had only few samples from the PC version.
If you have samples from both those platforms would be great.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

aluigi wrote:If you have samples from both those platforms would be great.

I'll do my best.

EDIT: Here's the PS3 version:
https://mega.nz/#!YFEg0RTD!T9ALB3q9o9WIOBzreIb4JaghmbJa5yGxZ7dUP-HFKhU
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

Try this script, if the encryption and the format is the same of other Codemasters game then it will work:
http://aluigi.org/bms/codemasters_nefs.bms
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

Strange, I tested this script with said .nfs files and all it found was "0 files"... am I doing something wrong?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

No, you did it correctly but I have just found the solution :D

The Codemasters games use the NFS archives for non encrypted data and NEFS for encrypted data.
But some games like Toybox Turbos opted for a custom encryption.

So now I launched the Toybox script on the file you provided and ... magic :)
http://aluigi.org/bms/toyboxturbos.bms
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

So I executed that script and it worked(output was ps3_000_new.nfs). Now I used that same script(codemasters_nefs.bms) and still nothing. Should I give you a sample or something?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

Interesting, it seems not fully compatible with the NFS format.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

Okay, here's the sample anyway.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

The experiment failed, anyway I have updated the f1_race_stars.bms script but it will NOT extract all the files.
Long story short:
offzip -a -c 0x10000 -z -15 -Q ps3_000_new.nfs output_folder 0x70000
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

Well when I tested the update script it all went fine and dandy until this appeared:

Code: Select all

Error: the script uses more array indexes(11115) than supported(11115)

Last script line before the error or that produced the error:
  114 getarray CHUNK_ZSIZE 10 x

Then I had to use an alternative method you suggested(offzip solution), and so far the latter was succesful in extracting the whole archive(except for a few errors starting with the 0x37082d61 offset) while the former didn't even get to extract the entirety of the archive.

As a result, your script wasn't capable of extracting the compressed archive, so offzip wins.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

Yeah that's the same error I had here and it's just caused by the different encryption adopted from offset 0x40000 till the data offset 0x70000... a sort of double protection that obviously avoids to create a working script.
Anyway I tried (and failed) but it's good to have the format partially documented.

Epic win for offzip and its chunk-guessing option :D
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

And here is the sample for the X360 version. It also includes a decrypted file that I applied out of said archive using the toyboxturbos.bms script.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

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

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

Eh, Xbox games don't use zlib because XmemCompress is implemented natively, so bye bye offzip.
Also in this case the data between offset 0x40000 and the data of the files uses a different encryption, so bye bye script.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

Is there any other method to handle the x360_000.nfs files?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: F1 Race Stars (_toc.bundle)

Post by aluigi »

My mistake, it uses deflate just like the PC version so the offzip method is still the good one.
Even the chunk size is the same.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

Okay, so I'm here to report something regarding the x360_000_new.nfs file with the script:

Code: Select all

Error: the compressed zlib/deflate input is wrong or incomplete (-3)
Info:  algorithm   2
       offset      00255c00
       input size  0x00006a00 27136
       output size 0x00010000 65536
       result      0xffffffff -1

Error: the uncompressed data (-1) is bigger than the allocated buffer (65536)

Last script line before the error or that produced the error:
  117 clog MEMORY_FILE OFFSET CHUNK_ZSIZE 0x10000

offzip is still the definitive solution, and I say definitive because it is the only working solution at the moment...

Oh yeah, and about the location of the filenames:

Code: Select all

ps3_000_new.nfs - filenames
start: 0x28a4e offset
end: 0x2a4a9 offset

x360_000_new.nfs - filenames
start: 0x2b62e offset
end: 0x2d0a8 offset
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: F1 Race Stars (_toc.bundle)

Post by AnonBaiter »

And finally, after a long while, here is a sample from the Wii U version of the game. It doesn't use .nfs archives like the PS3 and Xbox 360 versions of the game did, although I'm afraid that just by running the f1_race_stars.bms script with this one might trigger an error.