Forged Alliance Forever Forged Alliance Forever Forums 2019-09-04T06:40:28+02:00 /feed.php?f=40&t=17276 2019-09-04T06:40:28+02:00 2019-09-04T06:40:28+02:00 /viewtopic.php?t=17276&p=177783#p177783 <![CDATA[Re: Howto Decode fafreplay body?]]> Python equivalent (probably not a smartest way but still)

Code:
import base64
import zlib

replay = 'C:\\ProgramData\\FAForever\\replays\\10123254-relentless.fafreplay'
f = open(replay,'r')
lines = f.readlines()[1:]
data = base64.b64decode(lines[0])
result = zlib.decompress(data[4:])
f.close()

Statistics: Posted by relent0r — 04 Sep 2019, 06:40


]]>
2019-03-05T03:34:11+02:00 2019-03-05T03:34:11+02:00 /viewtopic.php?t=17276&p=172453#p172453 <![CDATA[Re: Howto Decode fafreplay body?]]>
Thank's for sharing this!

Statistics: Posted by Uveso — 05 Mar 2019, 03:34


]]>
2019-03-05T00:10:31+02:00 2019-03-05T00:10:31+02:00 /viewtopic.php?t=17276&p=172450#p172450 <![CDATA[Re: Howto Decode fafreplay body?]]> This is for PHP.


Well, that block of C# code adds a 4-byte length to the beginning of the gzip-encoded data, which by definition includes a header and a CRC/length trailer. So of course the PHP functions won't recognize it. Cut out all of that BlockCopy crap.

Not tested, but maybe something like this:

https://www.neowin.net/forum/topic/9941 ... ring-gzip/

So code now is:
Code:
$parse_str = file("111111.fafreplay", FILE_IGNORE_NEW_LINES);
$body= $parse_str[1];
$body_d= base64_decode($body);
$uncompressed = gzuncompress (substr($body_d,4));

Statistics: Posted by MikZZ — 05 Mar 2019, 00:10


]]>
2019-03-04T22:32:50+02:00 2019-03-04T22:32:50+02:00 /viewtopic.php?t=17276&p=172445#p172445 <![CDATA[Re: Howto Decode fafreplay body?]]> If somebody can help me I will be glad.

As I know the basic thing is:
first decode string by base64
second decompress by zlib


I did that but has no luck.

Statistics: Posted by MikZZ — 04 Mar 2019, 22:32


]]>
2019-03-03T22:15:35+02:00 2019-03-03T22:15:35+02:00 /viewtopic.php?t=17276&p=172420#p172420 <![CDATA[Howto Decode fafreplay body?]]> I need help.
Cant understand how to uncompress body of fafreplay.

Here is example of PHP code.

Code:
$parse_str = file("111111.fafreplay", FILE_IGNORE_NEW_LINES);
$body= $parse_str[1];
$body_d= base64_decode($body);
$uncompressed = gzuncompress ($body_d);

But Im getting error: " gzuncompress(): data error"
I have no idea wahts going wrong.
Plese help.

Statistics: Posted by MikZZ — 03 Mar 2019, 22:15


]]>