Hi, previous FIFA 17 was known to contain ZSTD streams and it was pretty easy to pick them up by their headers. FIFA 18 also seems to have ZSTD streams but at many places the headers are not even complete (modified?) so its hard to pick ZSTD streams and dump them out.
Can anyone please find a solution to dump all the found ZSTD streams in a CAS file of this game ?
No, I can't. First because it's not clear what type of zstd it's used in fifa18 since zstd06 gives just invalid files and then some chunks use oodle or are no compressed at all.
What I did was updating my frostbite script to version 0.3.1, I will upload it in the next hours
aluigi wrote:No, I can't. First because it's not clear what type of zstd it's used in fifa18 since zstd06 gives just invalid files and then some chunks use oodle or are no compressed at all.
What I did was updating my frostbite script to version 0.3.1, I will upload it in the next hours
Hmmm maybe thats why in most of the cas files I wasnt even able to detect zstd unlike in FIFA 17 where I could find zstd everywhere, in FIFA 18 along with very few legit zstd chunks, only part of zstd headers were there so maybe they are not even zstd, they were oodle instead like you said.
What's strange is that these invalid zstd chunks have the same 0x0f70 flag of the good ones, the only difference is that 0x01000000 added to the decompressed chunk size which is just another flag (so the size is 24bit). Trying all the legacy zstd gave the same invalid results and even scanning all the compression algorithms was the same.
ZSTD files in FIFA 18 are using pre defined dictiomary. The buffer size has changed from 64K to 256K but the compressed size in header is now 24 bits and because of that we see 0x70 , 0x71,0x72,0x73. The lower bits should be added to compressed size.
And the pre defined ditionary is encrypted in initfs_Win32.
Interesting. So first of all we need the dictionary to use when the first 8bit flag is 1. Anyone?
That thing regarding 0x7* is not very clear, for example here I have "00 04 00 00 00 74 00 00" so I must copy 0x40000 bytes without compression to destination and should I append 4 zeroes to it?
In the meantime there was a typo in my script (FLAGS >= 0 instead of != 0) so I have updated it.
aluigi wrote: That thing regarding 0x7* is not very clear, for example here I have "00 04 00 00 00 74 00 00" so I must copy 0x40000 bytes without compression to destination and should I append 4 zeroes to it?
you should copy 0x40000 bytes without compression and you don't need to append anything. I have decrypted initfs and obtained the dictionary and I have tested it. Decompression works fine.