Fate/stay Night Realta Nua(PS2) .BIN files

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Fate/stay Night Realta Nua(PS2) .BIN files

Post by AnonBaiter »

Looks like a PS2 game is actually using .BIN archive files again. This time, 2 of them are stored in AFS files, while the other 2 has a "MF" header or something.

Here are the samples:
https://mega.nz/#!EYExybxQ!qhBT4Qa63x3Qyn1ahZUYqlbNy-xf85w3T7nUneQsttc
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by aluigi »

data1.bin can be extracted with:
http://aluigi.org/bms/afs.bms
Then reuse the script on the 2 extracted files you get from it.

data2.bin and data.bin have no file table apparently ("MF" is just one of the archived files).

data0.bin has something at the end but they appear only filenames without offset/size fields.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by AnonBaiter »

I'll try that one. I just find it weird that they packed these "MF" or "AFS" files into four .BIN archive files while the developers were making the port, though.

EDIT: I've just made a breakdown of what are these files. The results so far:

Code: Select all

DATA.BIN - MF archive file.
DATA0.BIN - Contains AFS files.
DATA1.BIN - Contains AFS files.
DATA2.BIN - MF archive file.

DATA.BIN file location:
0h - MF header
800h - MF header*
(they were stored without a file table, thus the information for these files are unknown at this point)
14BB800h - .PSS file
8190000h - .PSS file
EE64800h - .PSS file
15B38804h - DATA.BIN files end here

DATA2.BIN file location:
0h - MF header
800h - UFFA/MF(?) header*
(they were stored without a file table, thus the information for these files are unknown at this point)
3D28B680h - DATA2.BIN files end here

*That's where it stores all the files.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by AnonBaiter »

Oh yeah and I found a PC version of that same game and I found a .xp3 file that starts with a "MZP" header. Here's a sample:
https://mega.nz/#!1cU2hJCS!ZixXiKtxAp8bAVLZ5oAtvrL5UtSOiOtnH6nKz0gaD-U
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by aluigi »

In my opinion those are just raw container without file table.
The first PNG in bgimage.xp3 is 0x14bab bytes but there are no references about it and there are full files both at beginning (dll) and end (png) without space for information.
The table is somewhere else.
RikuKH3
Posts: 5
Joined: Mon Sep 04, 2017 8:42 am

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by RikuKH3 »

I wrote a tool for those MF UFFA compressed archives:
https://github.com/RikuKH3/mf_pack/releases

Game texts stored in DATA2/15.mf, font is in DATA2/14.mf
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by aluigi »

Ah it's one of those nested archives.
The samples are no longer available but I'm sure it works :)
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by AnonBaiter »

Hmm. I might try that out someday once I get to obtain the game again.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by aluigi »

In the meantime I have made also a script based on the info of RikuKH3, I can't test it but it's just a temporary solution since I would like to try to parse the archives recursively (but I need a sample or it may not work):
http://aluigi.org/bms/mf_uffa.bms
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Fate/stay Night Realta Nua(PS2) .BIN files

Post by AnonBaiter »

Okay, I got the game again(as in, right now and right away - couldn't leave anything like this hanging by this point). I tested RikuKH3's mf_pack tool and it works perfectly with both DATA.BIN and DATA2.BIN.

As for aluigi's script, I decided to tweak it so it can handle "compressed" files more directly rather than just outright calculating the OFFSET and ZSIZE fields for whatever reason. It works just as well, so I decided to attach it here.

Both "tools" as mentioned above can be reused on either .mf files(assuming you use mf_pack) or .dat files, depending on which one you're using at the moment. DATA0.BIN and DATA1.BIN are simply AFS archives, therefore they can be extracted and reused within the extracted AFS archives(yes, there are literally AFS archives stored in said .BIN archives) through the afs.bms script without much problem.

I can set up a sample file for upload if the need arises.