FIFA 18 (CAS) Files - ZSTD streams dumping help

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FIFA 18 (CAS) Files - ZSTD streams dumping help

Post by aluigi »

ZSTD_MAGICNUMBER, good catch :)
RageX
Posts: 26
Joined: Fri Oct 09, 2015 3:38 pm

Re: FIFA 18 (CAS) Files - ZSTD streams dumping help

Post by RageX »

^The script works great now, thanks . and @deepshit.
cyberspeed
Posts: 104
Joined: Wed Mar 23, 2016 5:11 am

Re: FIFA 18 (CAS) Files - ZSTD streams dumping help

Post by cyberspeed »

aluigi wrote:I bet the problem is the finalSize 32bit field that apparently is a 24bit:

Code: Select all

01 00 04 60 0f 70 00 b0
So 0x460 is read as 0x01000460.

Are you using FB2Dumper.py?
If yes then find the following line:

Code: Select all

finalSize, magic, payloadLen = unpack(">IHH", cas.read(8))
and add this line after it:

Code: Select all

finalSize &= 0x00ffffff

Hi aluigi,

I am using that script you mention on MEA game, and no matter if I add the line you mention or not, I still get the following error after it extracts/dumps some files,

Code: Select all

Traceback (most recent call last):
  File "C:\MEADumper (2).py", line 319, in <module>
    dumpRoot(g_MainDataRoot)
  File "C:\MEADumper (2).py", line 289, in dumpRoot
    dump(fname, g_TargetDirectory)
  File "C:\MEADumper (2).py", line 203, in dump
    casPayload(entry, targetPath, sourcePath, entry.size)
  File "C:\MEADumper (2).py", line 263, in casPayload
    finalSize, magic, payloadLen = unpack(">IHH", cas.read(8))
error: unpack requires a string argument of length 8

any clue as to how can I get passed it ?