Spider-Man Unlimited (Android) .Dat

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Spider-Man Unlimited (Android) .Dat

Post by Doprond »

Greetings,can anyone take a look at these files?
I tried rename .dat to .zip but it didn't help.. (previously this method worked fine)
Samples here:
https://mega.nz/#!XhgimD5L!pYeCW1Pcy5yg ... uOSSRLQkAY
Thanks.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by aluigi »

Try the following:
download the zip2.bms script http://aluigi.org/bms/zip2.bms
open it with a text editor and replace the 3 occurrencies of the "idstring" command with a simple: get DUMMY long
Now use the edited script on the these dat archives.
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

Thanks for the help luigi.I tried your script and changed "idstring" to "get DUMMY long"
but i got this error while trying to extract some dat files,can you fix it?
Image
Thanks in advance!
P.S I can upload all game .Dat's if this can help :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by aluigi »

I meant the whole idstring line :D
Instead of idstring "PK..." you must have just get DUMMY long
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

Did i do something wrong?
Image

Code: Select all

# ZIP files (alternative way) 0.1
#   get end of directory and parses central directory
# script for QuickBMS http://quickbms.aluigi.org

goto -0x16
idstring get DUMMY long
        get disk_num        short
        get disk_start      short
        get central_entries short
        get central_entries short
        get central_size    long
        get central_offset  long
        get comm_len        short
        getdstring comment  comm_len

for i = 0 < central_entries
    goto central_offset
    idstring get DUMMY long
        get ver_made        short
        get ver_need        short
        get flag            short
        get method          short
        get modtime         short
        get moddate         short
        get crc             long
        get comp_size       long
        get uncomp_size     long
        get name_len        short
        get extra_len       short
        get comm_len        short
        get disknum         short
        get int_attr        short
        get ext_attr        long
        get rel_offset      long
        getdstring name     name_len
        getdstring extra    extra_len
        getdstring comment  comm_len
    savepos central_offset

    goto rel_offset
    idstring get DUMMY long
        get ver             short
        get flag            short
        get method          short
        get modtime         short
        get moddate         short
        get crc             long
        get comp_size       long
        get uncomp_size     long
        get name_len        short
        get extra_len       short
        getdstring name     name_len
        getdstring extra    extra_len
        savepos offset

        if method == 0
            Log name offset uncomp_size
        else
            if method == 8
                ComType deflate
            elif method == 1
                ComType unshrink
            elif method == 6
                ComType explode
            elif method == 9
                ComType deflate64
            elif method == 12
                ComType bzip2
            elif method == 14
                ComType lzmaefs
            elif method == 13
                ComType XMemDecompress
            elif method == 21
                ComType XMemDecompress
            elif method == 64
                ComType darksector
            elif method == 98
                ComType ppmd
            elif method == 99
                print "this script doesn't support AES encryption"
                cleanexit
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size
        endif
next i


P.S Sorry for my noobness :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by aluigi »

from:

Code: Select all

idstring get DUMMY long

to:

Code: Select all

get DUMMY long
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

Thanks a lot! now everything works nice :D
Edit: Oh..looks like it doesn't work good with some .dat files
Image
But anyways here a more Dat samples,i hope they will help you:
https://mega.nz/#!OpJywBYT!Ka3xFFkkZks2 ... F4W8YKPhb0
Thanks.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by aluigi »

Because not all the files are ZIP archives ("RN" 0x07 0x09 and "QM" 0x06 0x08).
For example:
- file000000.dat is just a sequence of random bytes (maybe encrypted)
- file000079.dat is a PNG image with the first 4 bytes modified (0x8a "RQK"), set them to 0x89 "PNG" to view these files
- file000092.dat is a model I guess with the usual first 4 bytes modified ("GYV" 0x0f)

That's all, there are no other formats.
SickAlice
Posts: 21
Joined: Mon Oct 24, 2016 3:23 am

Re: Spider-Man Unlimited (Android) .Dat

Post by SickAlice »

Anyone have any luck with the .bdae files in this. It's my most requested game to set up and rig 3d models from, I'd appreciate it mucho. The character .bdae can be opened as zip files as well, containing an endian .bdae and a script inside. Past that I'm stuck. My nearest understanding is this game was built right on the Minion Rush engine. However it seems to use all sorts of filetypes so it's tough to say if they're the same as that game. I can upload some examples if need be. I've opened up all the dats and dug out everything else thanks to whats here.
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

In newest game update .dat files structure was changed,and now almost every .dat file starts with RN header.
So,how i can unpack them? modifed script doesn't work
Samples in case if anyone wanna help:
https://mega.nz/#!ewZkVIab!ETxnrJnLavUM ... TY67NrXSjI

Thanks in advance!
Last edited by Doprond on Sat Jul 15, 2017 3:28 pm, edited 1 time in total.
wattostudios
Posts: 20
Joined: Fri Jun 02, 2017 2:15 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by wattostudios »

The format (at least for the few I looked at) is as follows...

Code: Select all

+--------------------------------------+
| Spider-Man Unlimited (Android) *.dat |
+--------------------------------------+

// ALMOST a PKZIP file, with different headers - so very similar!
// The header is "RN" for the first file, and "QL" for all other files

// FILE DATA
  // for each file
    2 - Header ("RN" for the first file, "QL" for all other files)
    4 - Unknown
    4 - null
    8 - Checksum?
    4 - Compressed File Size
    4 - Decompressed File Size
    4 - Filename Length
    X - Filename
    X - File Data
 
// DIRECTORY
  // for each file
    4 - Unknown
    2 - Unknown (20)
    2 - Unknown (10)
    4 - null
    8 - Checksum?
    4 - Compressed File Size
    4 - Decompressed File Size
    4 - Filename Length
    6 - null
    4 - Unknown
    4 - File Offset
    X - Filename
 
// ARCHIVE FOOTER
  4 - Unknown
  4 - null
  2 - Number of Files
  2 - Number of Files
  4 - Directory Length
  4 - Directory Offset
  2 - null


I'm assuming that the Compressed and Decompressed lengths are in the order above, the same as in a ZIP file.

It looks like this archive doesn't use compression, but if they want to compress any files, they actually ZIP the individual file into a normal ZIP structure, then stick that whole file in the DAT archive? For example, look at File0003.dat - the first file is a TGA image, however the file data itself starts with a "PK" ZIP header instead of actual image data, so they "zipped" up the TGA image and then stuck it in this DAT archive. The DAT archive doesn't know that it's a zipped file though - ie the DecompLength and CompLength are the same, so you'll have to read the "PK" header to know if it's actually compressed or not.

Anyone care to do a BMS for this?
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

I tried to take a look at file003.dat file,and i found what it have more than 1 PK entries,how i can split these entries to separate files?
Btw,is there any chance for the script? can you to do that?
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Spider-Man Unlimited (Android) .Dat

Post by Acewell »

here is a bms script i whipped up that works with most :D

Code: Select all

for i = 0
    get CHECK long
    if CHECK == 0x07050701
        break
    elif CHECK == 0x02014b50
        break
    endif
    goto 0xe 0 SEEK_CUR
    get ZSIZE long
    get SIZE long
    get NAME_SIZE long
    getdstring NAME NAME_SIZE
    savepos OFFSET
    get CHECK2 byte
    if CHECK2 == 0x34
        string NAME - tga
        string NAME + pvr
    endif
    if ZSIZE < SIZE
        comtype deflate //?
        clog NAME OFFSET ZSIZE SIZE
    else
        log NAME OFFSET ZSIZE
    endif
    math OFFSET + ZSIZE
    goto OFFSET
next i

these samples are giving problems currently, may have to adjust the script a bit :)
File0004.dat - png file?
File0010.dat - contains some zlib compressed data
File0023.dat - contains some zlib compressed data
may need to use first 2 bytes as ID to distinguish the compression types
Doprond
Posts: 67
Joined: Tue Mar 15, 2016 3:38 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by Doprond »

Any progress?
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Spider-Man Unlimited (Android) .Dat

Post by KL3W »

Hey!

I have also bdae files (in fact bres files) in LEGO STAR WARS CASTAWAYS video game (Gameloft game). Any success with brres files? Any QUICKBMS script?

Thx for answering