FIFA 17

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
NoFaTe
Posts: 4
Joined: Tue Oct 11, 2016 5:10 pm

Re: FIFA 17

Post by NoFaTe »

However, if you just want to add support for older versions to your script and save some time, the compression algorithm being used (which is what frank re-implemented in his LZ77 DLL) is LZ4.

Here's a code snippet of how to decompress a compressed chunk (0x0970 type) in older versions:
http://pastebin.com/rKxRSHVa
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FIFA 17

Post by aluigi »

Thanks for all the info :)
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FIFA 17

Post by AnonBaiter »

So, now that we have enough information for the Frostbite archives, is the script ready or put on hold?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FIFA 17

Post by aluigi »

On my side I opted for a big break.
I will return on this stuff when it's the right moment.
dav04
Posts: 1
Joined: Tue Feb 07, 2017 7:10 pm

Re: FIFA 17

Post by dav04 »

Any news about this script?
Thanks.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FIFA 17

Post by aluigi »

There will be no updates on the script.
Use the solutions provided in the previous posts.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: FIFA 17

Post by AnonBaiter »

So I did this strange edit with frostbite.bms:

Code: Select all

startfunction RAW_CAS_CAT
   open FDSE "cas.cat"
   goto TOC_OFFSET
   idstring "NyanNyanNyanNyan"
   get FILES long
   getdstring ZERO 20
   if ZERO != "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      goto -16 0 SEEK_CUR
   endif
   math LAST_PACK_NUM = -1
   for i = 0 < FILES
      getdstring HASH 20
      get FOFFSET long
      get FSIZE long
      get ZERO long
      get PACK_NUM long
      if PACK_NUM != LAST_PACK_NUM
         math LAST_PACK_NUM = PACK_NUM
         get PACK_NAME basename
         string TMP p "%s_%02d.%s" PACK_NAME PACK_NUM PACK_NAME
         open FDSE TMP 1
      endif
      log "" FOFFSET FSIZE 1
   next i
endfunction
The reason I even managed to pull this off was because the script could trigger an error whether the "ZERO" value wasn`t a zero at all:

Code: Select all

. 0000000000000240 getdstr ZERO       "" 20
    00 00 00 00 20 bb 4f 61 04 b3 c5 2d 09 7c 9c 13   .... .Oa...-.|..
    d8 a0 7c 0d     
The error in question was this:

Code: Select all

Last script line before the error or that produced the error:
  422 open FDSE TMP 1
So I had to make an edit so that the script stays compartible with more recent games that use the Frostbite 3 engine.
I only tested this on Mirror`s Edge Catalyst, so I have no idea if this "workaround" can also work with Star Wars Battlefront, Battlefield 1 or even FIFA 17.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: FIFA 17

Post by aluigi »

NoFaTe wrote:Yes, the compression algorithm in use is a legacy version of zstd.

ZSTDv06_decompress
The algorithm is available in the quickbms source code but it's not compiled in, I will add it in the next version of quickbms.
The lack of retrocompatibility in zstd is really annoying, now I need to add a "new" legacy version everytime the algorithm is updated... boooring