Decrypting .sc2replay

13 views
Skip to first unread message

Paul

unread,
Sep 16, 2011, 8:03:55 PM9/16/11
to phpsc2replay
Hi,
I was out of interest looking to see if any programs had been made
that do statistical analysis of replays and came across your project.
I downloaded the source code and looked at it and a lot of seemed to
be decrypting and hash tables and stuff and I don't think looking at
the code is a very good way for me to start. So I was just wondering
if you would be able to point me to something to help me understand
all this? Also I know the very basics of hash tables/decrypting
because I'm doing things like this at uni but I'd like to understand
specifically how it applies in this situation. For example, how did
you go about making this program, where did you start? How did you
know what to do? Thanks for any help.

Paul

Zsol

unread,
Sep 17, 2011, 2:58:05 AM9/17/11
to phpsc2...@googlegroups.com
Hey Paul,

When I work on the replay format, I usually fire up a hex editor and
stare at the bytes for a few minutes/hours/days. In this sense, it's
much like solving an integral :) I just stare at it and try to
recognize patterns and then assign meaning to them.

There is no reason to start from scratch, though, as there is already
some nice documentation lying around the interwebz. One of these gems
is courtesy of the sc2reader project:
https://github.com/GraylinKim/sc2reader/wiki (you might also want to
check out their code, that is a much more structured approach to
replay parsing). For phpsc2replay, much of our documentation is out of
date; our reference is usually the code itself.

There are other projects that analyze replays, most notably there is
sc2gears, which unfortunately is written in java and is not open
source.

Good luck,
Zsol

Paul

unread,
Sep 17, 2011, 9:32:32 AM9/17/11
to phpsc2replay
Thanks for the info, it really helped. I just have one question which
you might not be able to answer. It seems the replay only keeps track
of the players actions, it doesn't keep track of things like income
etc, so does it just generate these statistics when you are watching
the replay file? And also does it do the same with the score screen at
the end of the game? Does it just calculate score, army size etc every
time the replay file is played, or is it stored somewhere in the file?
Since there are many parts of the file which serve a currently unknown
purpose I know it could be there, but is this likely, or am I wasting
my time if I try to find that? Seems like the following applies to me,
although I'm looking for income not build orders:
https://github.com/GraylinKim/sc2reader/wiki/Frequently-Asked-Questions

On Sep 17, 7:58 am, Zsol <z...@starcraft2.hu> wrote:
> Hey Paul,
>
> When I work on the replay format, I usually fire up a hex editor and
> stare at the bytes for a few minutes/hours/days. In this sense, it's
> much like solving an integral :) I just stare at it and try to
> recognize patterns and then assign meaning to them.
>
> There is no reason to start from scratch, though, as there is already
> some nice documentation lying around the interwebz. One of these gems
> is courtesy of the sc2reader project:https://github.com/GraylinKim/sc2reader/wiki(you might also want to

Zsol

unread,
Sep 17, 2011, 9:42:29 AM9/17/11
to phpsc2...@googlegroups.com
We think these kinds of information are not included in the replay,
and that is probably one of the reasons you can't skip forward when
you load a replay in the game initially.
To simulate the income, you would effectively need the replay file +
the game engine + the map. If you are missing any one of those, it is
probably impossible to replicate these aspects of the game.

Paul

unread,
Sep 17, 2011, 10:06:59 AM9/17/11
to phpsc2replay
Ok that's what I thought, thanks for all your help! :)
> >> is courtesy of the sc2reader project:https://github.com/GraylinKim/sc2reader/wiki(youmight also want to
Reply all
Reply to author
Forward
0 new messages