Need for Speed Undercover BUN

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Need for Speed Undercover BUN

Post by AntonZab »

Need for Speed Undercover BUN files


Samples


https://drive.google.com/file/d/0B0oEDr ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Re: Need for Speed Undercover BUN

Post by AntonZab »

Almost all of the files are decompressed. Besides


https://drive.google.com/file/d/0B0oEDr ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

No way to extract that archive because I don't see valid offset and size fields.
Additionally I suspect the files may be compressed, they have a 22 11 44 55 header with a FRPK magic.

Is that one the only file that can't be extracted?
AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Re: Need for Speed Undercover BUN

Post by AntonZab »

In New archive File Globalb.bun(13 mb) after unpacking takes 3 mb. other bun files give error


https://drive.google.com/file/d/0B0oEDr ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

It looks like I did something magic for all the bun archives.
Script 0.2 supporting ALL the samples you provided, VINYLTHUMBNAILS.BUN included.
AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Re: Need for Speed Undercover BUN

Post by AntonZab »

After update Script 0.2. Globala.bun - Error. GlobalB.bun - Duplicate files.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

It's enough to press 'r' when quickbms asks what to do.
The alternative is using the -d or -D option by command-line or by creating a shortcut to quickbms.exe with one of these 2 options in the Target entry of the properties.
If you prefer I can update the script to read the "path" from the first block of data and avoiding the duplicate names.
AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Re: Need for Speed Undercover BUN

Post by AntonZab »

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

Re: Need for Speed Undercover BUN

Post by aluigi »

I have made another big rewrite of the script.
Now it's version 0.3 and extract also the compressed files.

The reason of all these versions is the complexity of the format because it's not just a normal archive.
Anyway I guess you will be satisfied of the results.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

I have updated the script to version 0.3.1 but the changes do NOT affect Need for Speed Undercover, so what you got with the previous script is exactly the same like this one.

I have simply added 3 other algorithms because those BUN/BIN archives are used also in Need for Speed World where they used RAWW (just copy), JDLZ, HUFF and COMP that are all compresison algorithms that will be available in the next quickbms :D
Not Available
Posts: 9
Joined: Fri Nov 13, 2015 6:09 pm

Re: Need for Speed Undercover BUN

Post by Not Available »

First of all, sorry for the long post. (I've been lurking here and on Xentax for a few years now)

aluigi wrote:I have simply added 3 other algorithms because those BUN/BIN archives are used also in Need for Speed World
There's some interesting work w.r.t. NFSW on the offline server work. (Although it runs against EA's T.O.S. :|)

where they used RAWW (just copy), JDLZ, HUFF and COMP that are all compresison algorithms that will be available in the next quickbms :D
I've also stumbled on the COMP type in the PS2 copy of Hot Pursuit 2. (Was developed by Blackbox), but haven't started looking into it as I haven't even determined what file structure zzdata.bin holds.

(I was wondering if you could have a look, most chunks are probably missing names, but using the folder directory from Underground might fill in the the gaps)

--------------------------------------------------------------------------------------------------------------------------

I'm sticking my findings/hypothesis and what I managed to do so far below. (on Hot Pursuit 2 zzdata.bin)

I'm assuming zzdata.bin in NFS:HP2 is stored in chunks based off research leftovers on NFSCars/NFSCheats from others on NFS:Underground (NFS:U) geometry.bin files.

Based on the pattern of bytes in zdir.bin, I guess each chunk of data is stored by 12 bytes (or 3 long/floats), holding data about each chunk in zzdata.bin, but I haven't got anything past that (I haven't found any significance)

I decided to compare the PS2 copy HP2 with a PC copy of NFS: Underground (NFS:U) I had never used before from a 4-pack I bought for the classic (aka, NFS 1-> 6) NFS games .

and so far managed to make these comparisons: (Using a combo of grep and hex editor)
1) CharactersA.bin exists in 2 different instances in the PS2 copy of HP2, but exists as an empty (0 byte) file in Underground (leftover)
2) Same text, LOD node naming convention (like /<CarName>/geometry.bin, /<CarName>/textures.tpk, etc)
3) Comparing the same file name, (eg, 4dr_sedan/geometry.bin), the "header data" is in different places, and the data chunks are stored in different order. (relative to where it is in both respective files)
4) Extract 2 (maybe partial) different instances of Charactersa.bin from HP2 zzdata.bin through a hex editor, but I lack the knowledge of the file system, and how geometry data is stored in binary.

For extra measure, I decided to find a PS2 demo of NFS:Underground to compare against and noted:
1) the header data is more like the PC copy of Underground which I have and
2) ended up seeing the same COMP type header and alot of gibberish (for me) afterwards, along with A1CL and MOIR types.

I've attached samples of zzdata.bin and the complete zDir.bin from the ps2 versions of Hot Pursuit and Underground.

As for the compressions, from spending a few days searching, I've read the compression code is stored in the EXE from posts on NFSCars, but I haven't applied that knowledge yet. (And I'm stuck as how to apply it to PS2 elf files.)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

I have just made a test with quickbms 0.7.1 (not public yet) and a quick modification made to nfsu_bun.bms and it worked perfectly.

Do you have also the beginning of the zzdata1.bin file?
I have read about the others zzdata*.bin files on some posts on the Internet but there are no references in zdir.bin.
Not Available
Posts: 9
Joined: Fri Nov 13, 2015 6:09 pm

Re: Need for Speed Undercover BUN

Post by Not Available »

aluigi wrote:I have just made a test with quickbms 0.7.1 (not public yet) and a quick modification made to nfsu_bun.bms and it worked perfectly.

Do you have also the beginning of the zzdata1.bin file?
I have read about the others zzdata*.bin files on some posts on the Internet but there are no references in zdir.bin.

Not in the retail or demo copies I own. (I have a gap in my library from Underground -> NFS:Nitro)

The 2 PS2 versions of Hot Pursuit 2 retail and the Underground demo, the data is stored in single zzdata.bin files.

My PC copy of Underground, the files are in folders more like NFSW files. (well definitely the car and Global folders)

I looked at a retail ps2 copy of Underground I downloaded to look at the folder structure, and can confirm 4 zzdata*.bin files.
zDir.bin also has a larger file size in the retail version compared to the demo version. (Kinda obvious)
It's sitting in the recycling bin at the moment, so I can pull them out and trim them if you want.
I can always go out and buy myself a copy, but I'm not an Underground Fan, or I could ask someone on WG as there was a recent discussion about a Japanese version of Underground.

Not sure about other Playstation versions of NFS8, 9, etc. as it fell outside of my area of interest (was further removed from Hot Pursuit 2), but a cursory google search makes me feel like they also split the data file in a similar way as Underground.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

Can you upload the zdir.bin file of the game that has multiple zzdata*.bin?
Not Available
Posts: 9
Joined: Fri Nov 13, 2015 6:09 pm

Re: Need for Speed Undercover BUN

Post by Not Available »

Here's the zdir.bin file from the retail standard PS2 version of NFS:Underground. (Just to differentiate it from a special version of Underground for the Japanese market on the PS2 which I know of, but am not interested in comparing)

Also I added the splitted zzdata0 and zzdata1.bin files from the same game version.
In case it's not in the same sequence compared to the Underground demo one.
The other 2 I left out are zzdata2.bin and zzdata3.bin.


ironic how the forum hates attaching .bin file extentions as is...
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

Ok I guess I have been able to cover all or most of the files of these games.
The new script will be uploaded when quickbms 0.7.1 will be released in the next hours.
Not Available
Posts: 9
Joined: Fri Nov 13, 2015 6:09 pm

Re: Need for Speed Undercover BUN

Post by Not Available »

\o/
Now I have to feel my way through the files.
(I need to learn how to recognize dds files missing the header and re-add the file header before I can do anything)

At least it split cars\CLK_GTR\geometry.bin nicely so all the parts and LOD stuff are in the same files. (So that means the order of the parts are different compared to Underground geometry.bin files)

Same thing for Charactersa.bin. (I found 4 instances in the unpacked files, compared them binary wise, and it's 2 identical pairs, which I guess are copies stored in the COMP'ed chunks)

add-on: Also I started looking through the unpacked files in NFSW. (end-of-the-world build)
Unpacked gfx_tex.bin and 3B2B1AF4.vyl (I took a look through my backed up persona, turn a hash into hex...), and I see xml/dds filenames but like earlier in this post, I need to learn how to recognize geometry data & textures missing headers.

hopefully I'll be able to use a patched updater system to load version 4 client builds and recover the lost safehouse from December 2010 builds.. I really need to poke someone else on info about the launcher's workings)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need for Speed Undercover BUN

Post by aluigi »

Ah, I forgot to say that script 0.4 and quickbms 0.7.1 are finally available :D
AntonZab
Posts: 461
Joined: Thu Oct 01, 2015 5:03 pm

Re: Need for Speed Undercover BUN

Post by AntonZab »

Thanks. Aluigi