any progress?
Can't wait to mod wd2
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
watch dogs 2 .dat .fat archive?
-
- beginner
- Posts: 20
- Joined: Sat Sep 20, 2014 10:20 am
- Has thanked: 2 times
- Been thanked: 1 time
Re: watch dogs 2 .dat .fat archive?
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) :
videos.fat ( you'll notice the second column is mostly zeroes ):
sound.fat ( second column is also mostly zeroes, also note this is one of the files with 00004600 for bytes 9-12 ):
Here are some fats for 0 byte dat files:
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) :
videos.fat ( you'll notice the second column is mostly zeroes ):
sound.fat ( second column is also mostly zeroes, also note this is one of the files with 00004600 for bytes 9-12 ):
Here are some fats for 0 byte dat files:
Re: watch dogs 2 .dat .fat archive?
i suppose we could modify the quick bms script for fat files? i really wise we knew how to modify gibbs tools
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2870 times
Re: watch dogs 2 .dat .fat archive?
i know how to modify gibbed tools, but i doubt it will help. Do you think the format is similar to Watch dogs 1?
-
- advanced
- Posts: 40
- Joined: Sat Dec 03, 2016 4:35 am
- Has thanked: 7 times
- Been thanked: 5 times
Re: watch dogs 2 .dat .fat archive?
i have found rick/gibbed 's twitter,maybe someone can ask him about the disrupt tool
https://twitter.com/gibbed/with_replies
https://twitter.com/gibbed/with_replies
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: watch dogs 2 .dat .fat archive?
Header:
Entry:
for gibbed source's
Compression seems is LZ series
Code: Select all
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;
Code: Select all
dwHash: uint64_t; //NameHash
dwSize: uint32_t;
dwOffset: uint32_t;
dwZSize: uint32_t;
Code: Select all
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);
Last edited by Ekey on Wed Dec 07, 2016 1:22 am, edited 3 times in total.
My Github repo
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: watch dogs 2 .dat .fat archive?
Interesting.. there are 2 types of compression? Or One > LZMA + LZ4 ?
My Github repo
Re: watch dogs 2 .dat .fat archive?
Two types.
Type 2 is the modified LZ4, 0 is LZMA.
Code: Select all
#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)
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: watch dogs 2 .dat .fat archive?
Hash is Fnv1a x64
Code: Select all
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;
}
My Github repo
-
- beginner
- Posts: 20
- Joined: Sat Sep 20, 2014 10:20 am
- Has thanked: 2 times
- Been thanked: 1 time
Re: watch dogs 2 .dat .fat archive?
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?
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: watch dogs 2 .dat .fat archive?
Yup. Currently i have not found a piece code of compression in library. Maybe Sir Kane can give a some hint'sdisastorm wrote:Is the last thing to just get the compression correct?
My Github repo
-
- beginner
- Posts: 20
- Joined: Sat Sep 20, 2014 10:20 am
- Has thanked: 2 times
- Been thanked: 1 time
Re: watch dogs 2 .dat .fat archive?
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?
-
- ultra-veteran
- Posts: 452
- Joined: Sun Jul 06, 2014 6:30 am
- Has thanked: 110 times
- Been thanked: 326 times
Re: watch dogs 2 .dat .fat archive?
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
http://www.zenhax.com/viewtopic.php?f=9&t=378#p11725
Re: watch dogs 2 .dat .fat archive?
0xE6C is good constant to look for to find the LZMA code (which turns out to be slightly modified, too).