[SOLVED] Disney Infinity 2.0 main DAT archive

Codecs, formats, encoding/decoding of game audio, video and music
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

[SOLVED] Disney Infinity 2.0 main DAT archive

Post by AlphaTwentyThree »

Hello!

I've just stumbled upon a non-standard ZIP file in the above game (for PS Vita). All files are in a file of 3gb and the identifier looks like zip. However, when opened with 7zip it only shows a very small portion (or the first ZIP block?). Here's the first and last 1mb of the file: https://1fichier.com/?ay430mpn3u9zy0lfr5a4
Thanks for your help!

EDIT: Working script below!
Last edited by AlphaTwentyThree on Sun Jun 12, 2022 8:49 am, edited 2 times in total.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by AlphaTwentyThree »

ah sorry, accidentally posted in wrong section - please move to "Game archives"
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by DKDave »

I think the issue is that there are many different files in that 3GB archive, so there must be a mater file table elsewhere. For example, if you look at offset 0xeec77 in your last 1mb file - that is the start of a normal zip file. If you save the data from that point to the end, it will open as a normal zip.

Similarly, in your first 1mb file, the first part is a zip file from 0 - 0x3c173.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by AlphaTwentyThree »

Hm, maybe that strange ManifestFile.dat? Attached.
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by DKDave »

AlphaTwentyThree wrote:Hm, maybe that strange ManifestFile.dat? Attached.


Yeah, that contains the file offsets in decimal form. Looks like 3 values per entry: first entry is -1257310739 which is probably some CRC/filename hash, then you've got file offset (0), and file size (246131), which corresponds to the first file in the archive.

And the final file in the archive should be at offset 0xce1b97e7 with a size of 0x11389.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by AlphaTwentyThree »

Ok, thanks. Is there a command that directly lets me read the values correctly or do I need to make a converter function?
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by DKDave »

AlphaTwentyThree wrote:Ok, thanks. Is there a command that directly lets me read the values correctly or do I need to make a converter function?


I did a QuickBMS script to read them - not sure if it works properly as I don't have the archive, but you can give it a try. It may fail when it gets to the negative values for the offsets, as you don't often get file table info in this format!

Just a couple of things before using it. In order to make sure the script works properly, add a comma after the final value in the manifest file - it's just a standard text file. And also replace "archive" with your archive name in my script.

di20.zip
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by AlphaTwentyThree »

ah, just a simple operation, you could have told that in the first place. ;)

Here's a working script that somehow still crashes at the end of the TOC. It extracts all the contents of the main archive though. I've added a type identifier portion for convenience.

Code: Select all

# game: Disney Infinity 2.0
# file: MasterFile.dat/ManifestFile.dat
# script type: extractor
#
# (c) 2022-06-11 by AlphaTwentyThree of ZenHax
# (with contribution: DKDave of ZenHax)
# script for QuickBMS http://quickbms.aluigi.org

open FDSE ManifestFile.dat 0
open FDSE MasterFile.dat 1
get TOC_SIZE asize 0
goto 1 0

For i = 0
   getCT HASH string 0x2c
   getCT OFFSET string 0x2c
   getCT SIZE string 0x2c
   math HASH = HASH
   math OFFSET = OFFSET
   math SIZE = SIZE
   savepos TEMP
   
   goto OFFSET 1
   getDstring TEST 4 1
   if TEST == "FSB5"
      set EXT "fsb"
   elif TEST == "KB2i"
      set EXT "bik"
   elif TEST == "RIFF"
      set EXT "fev"
   elif TEST == "NAME"
      set EXT "nam"
   elif TEST == "SMAP"
      set EXT "map"
   else
      goto OFFSET 1
      getDstring TEST 3 1
      if TEST == "DLG"
         set EXT "dlg"
      else
         goto OFFSET 1
         getDstring TEST 2 1
         if TEST == "PK"
            set EXT "zip"
         endif
      endif
   endif
   string FNAME P "%EXT%\%HASH%.%EXT%"
   log FNAME OFFSET SIZE 1
   goto TEMP 0
   if TEMP == TOC_SIZE
      cleanexit
   endif
next i
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by DKDave »

Wasn't sure if it would work, but luckily it seems to :-)
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Disney Infinity 2.0 - non-standard ZIP file

Post by AlphaTwentyThree »

Yeah, thanks for your input :D
Always nice to work together to solve a problem. :)