XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun Jan 22, 2017 11:29 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: watch dogs 2 .dat .fat archive?
PostPosted: Sat Dec 03, 2016 6:27 am 
Offline
beginner

Joined: Sat Dec 03, 2016 4:35 am
Posts: 30
Has thanked: 6 times
Have thanks: 1 time

any progress?
Can't wait to mod wd2

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Sat Dec 03, 2016 10:08 am 
Offline
beginner

Joined: Sat Sep 20, 2014 10:20 am
Posts: 20
Has thanked: 2 times
Have thanks: 1 time
I don't know anything about how to do this, but I'll post my thoughts on the fat file, maybe people who know stuff will see it and automatically know the answer.

It looks like the fat file may be best viewed at 20 bytes per line.

The first 8 bytes are always the same, probably the name and version or something like that. 35544146 0B000000

The next 4 bytes seem to have 2 variants: either 01064600 or 00004600

files with 01064600 :
common.fat
videos.fat
installpackage.fat
san_francisco_english.fat
san_francisco_hires.fat
san_francisco_preload.fat
san_francisco_cache.fat
san_francisco_cache_patch.fat
installpackage_english.fat
patch.fat
shadersobj.fat
san_francisco.fat

files with 00004600:
sound_english.fat
sound.fat
san_francisco_sound.fat
san_francisco_sound_english.fat


The 8 bytes after that are always all Fs in the initial header: FFFFFFFF FFFFFFFF
And the 4 bytes after that initial header thing is always 00000000.


Here are some fat images in case anyone has any ideas:
The fourth column in all of them seems to be constantly increasing I believe, but it doesnt start at zero and they seem too high to be offsets.

common.fat ( the second column seems to have some repeated values) :
Image

videos.fat ( you'll notice the second column is mostly zeroes ):
Image

sound.fat ( second column is also mostly zeroes, also note this is one of the files with 00004600 for bytes 9-12 ):
Image


Here are some fats for 0 byte dat files:
Image
Image


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Sat Dec 03, 2016 10:47 pm 
Offline
beginner

Joined: Sat Oct 04, 2014 5:22 am
Posts: 35
Has thanked: 0 time
Have thanks: 0 time
i suppose we could modify the quick bms script for fat files? i really wise we knew how to modify gibbs tools


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Tue Dec 06, 2016 10:26 am 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 933
Has thanked: 11 times
Have thanks: 335 times
i know how to modify gibbed tools, but i doubt it will help. Do you think the format is similar to Watch dogs 1?


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Tue Dec 06, 2016 4:36 pm 
Offline
beginner

Joined: Sat Dec 03, 2016 4:35 am
Posts: 30
Has thanked: 6 times
Have thanks: 1 time
i have found rick/gibbed 's twitter,maybe someone can ask him about the disrupt tool
https://twitter.com/gibbed/with_replies


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Tue Dec 06, 2016 4:40 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Wed Mar 31, 2010 6:54 am
Posts: 1571
Has thanked: 59 times
Have thanks: 699 times
Header:

Code:
    dwID: uint32_t; //5TAF
    dwVersion: uint32_t; //11
    dwUnknown1: uint32_t;
    dwUnknown2: uint32_t; //-1
    dwUnknown3: uint32_t; //-1
    dwUnknown4: uint32_t; //0
    dwTotalFiles: uint32_t;


Entry:

Code:
    dwHash: uint64_t; //NameHash
    dwSize: uint32_t;
    dwOffset: uint32_t;
    dwZSize: uint32_t;


for gibbed source's
Code:
           var a = TFileStream.ReadInt32();
           var b = TFileStream.ReadInt32();
           var c = TFileStream.ReadInt32();
           var d = TFileStream.ReadInt32();
           var e = TFileStream.ReadInt32();

           NameHash = a;
           NameHash |= ((ulong)b) << 32;
           Offset = (long)d << 2;
           Offset |= ((c & 0xC0000000u) >> 30);
           UncompressedSize = (uint)(e & 0xFFFFFFFC) >> 2;
           CompressedSize = (uint)((c & 0x3FFFFFFF) >> 0);


Compression seems is LZ series


Last edited by Ekey on Wed Dec 07, 2016 1:22 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Tue Dec 06, 2016 11:44 pm 
Offline
veteran

Joined: Mon Aug 06, 2012 4:14 am
Posts: 82
Has thanked: 0 time
Have thanks: 32 times
Yeah, it uses LZMA and modified version of LZ4.


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Tue Dec 06, 2016 11:46 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Wed Mar 31, 2010 6:54 am
Posts: 1571
Has thanked: 59 times
Have thanks: 699 times
Interesting.. there are 2 types of compression? Or One > LZMA + LZ4 ?


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 12:35 am 
Offline
veteran

Joined: Mon Aug 06, 2012 4:14 am
Posts: 82
Has thanked: 0 time
Have thanks: 32 times
Two types.
Code:
#pragma pack(push, 4)
struct SFatFileEntry{
   /*uint32_t   field_0;
   uint32_t   field_4;
   uint32_t   field_8;
   uint32_t   field_c;
   uint32_t   field_10;*/
   uint64_t   Hash;
   uint64_t   CompressedSize : 30;
   uint64_t   Offset : 34;
   uint32_t   CompressionMethod : 2;
   uint32_t   UncompressedSize : 30;
};
#pragma pack(pop)

Type 2 is the modified LZ4, 0 is LZMA.


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 12:59 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Wed Mar 31, 2010 6:54 am
Posts: 1571
Has thanked: 59 times
Have thanks: 699 times
Hash is Fnv1a x64

Code:
static ulong gethash64(string value)
{
    ulong fnv64Prime = 0x00000100000001B3ul;
    ulong hash = 0xCBF29CE484222325ul;

    for (var i = 0; i < value.Length; i++)
    {
        hash *= fnv64Prime;
        hash = hash ^ value[i];
    }

    return hash & 0x1FFFFFFFFFFFFFFFul | 0xA000000000000000ul;
}


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 12:37 pm 
Offline
beginner

Joined: Sat Sep 20, 2014 10:20 am
Posts: 20
Has thanked: 2 times
Have thanks: 1 time
Wow didn't expect people to continue this. I wish I could help more but not really sure what to do. It seems you guys figured out offset and file size? Is the last thing to just get the compression correct?


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 1:54 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Wed Mar 31, 2010 6:54 am
Posts: 1571
Has thanked: 59 times
Have thanks: 699 times
disastorm wrote:
Is the last thing to just get the compression correct?

Yup. Currently i have not found a piece code of compression in library. Maybe Sir Kane can give a some hint's :)


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 2:55 pm 
Offline
beginner

Joined: Sat Sep 20, 2014 10:20 am
Posts: 20
Has thanked: 2 times
Have thanks: 1 time
If I'm not mistaken, even after getting the compression, would we still need to figure out what the various values in the xmls are? didn't gibbed need to make some kind of binary class mapping files for the watch dogs 1 gibbed?


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Wed Dec 07, 2016 6:16 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 225
Has thanked: 32 times
Have thanks: 133 times
about the compression, this is the same problem Aluigi came across when unpacking another Ubisoft title, Far Cry: Primal. It also uses LZMA and an unknown LZ4. So that's something to keep in mind, perhaps some clues can be found in one game to benefit the other...

http://www.zenhax.com/viewtopic.php?f=9&t=378#p11725


Top
 Profile  
 
 Post subject: Re: watch dogs 2 .dat .fat archive?
PostPosted: Thu Dec 08, 2016 12:10 am 
Offline
veteran

Joined: Mon Aug 06, 2012 4:14 am
Posts: 82
Has thanked: 0 time
Have thanks: 32 times
0xE6C is good constant to look for to find the LZMA code (which turns out to be slightly modified, too).



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group