• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:23
CEST 04:23
KST 11:23
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed14Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
Who will win EWC 2025? Server Blocker RSL Revival patreon money discussion thread Weekly Cups (July 7-13): Classic continues to roll The GOAT ranking of GOAT rankings
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event Sea Duckling Open (Global, Bronze-Diamond) RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ [ASL19] Finals Recap: Standing Tall BW General Discussion Help: rep cant save
Tourneys
[Megathread] Daily Proleagues Cosmonarchy Pro Showmatches CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 676 users

s2gs file -- a fun little mystery for us - Page 5

Forum Index > SC2 General
Post a Reply
Prev 1 2 3 4 5 6 7 Next All
Fyrn
Profile Joined April 2011
Germany62 Posts
Last Edited: 2012-04-23 15:04:31
April 23 2012 14:59 GMT
#81
I'm kinda reluctant to dive into this at all - the hash retrieval, not the s2gs reversing, that is.

I've checked through the traffic preceeding the s2gs GET and it appears to be typical battle.net 2.0 protocol chatter, most of which has been reversed elsewhere. It's probably possible to get into this somehow, of course, but Blizzard isn't friendly to people attempting to reverse their protocols or implementing anything that makes use of it, as we should all know.

And since every other file in the cache, including the index, look clean it's pretty safe to assume that it's somewhere in the payload after the auth - and again, I'd rather not dive into that, especially in public.

I've also taken a look through all the web frontend stuff on battle.net, since they're at least displaying the match history there, but to no avail.

imho, the best bet would be to grab Morhaime on an upcoming Blizzard event and shake him until his team prioritizes a SC2 API. They just recently confirmed a D3 API (http://us.battle.net/wow/en/forum/topic/4217171883#10) and shortly before that confessed that while they'd like to do a SC2 API, it's not happening currently.

They seem to be slacking on these fronts ..I remember when I was racing Thott, reading from WoW memory after the savedvariables got cut in one of the beta pushes. Took them more than 5+ years, scraping terrabytes off the armory, until they had an API going. And all that while they have the massively popular WoW UI community going, necessarily realizing that third party stuff is 100% win-win. Gah. The lengths through which we have to go to obtain these bits of data is excruciating sometimes.
"I mean I could always win MLG Providence next year.." - The Little One
SirPsychoMantis
Profile Joined December 2011
United States180 Posts
April 23 2012 15:37 GMT
#82
On April 23 2012 23:31 Prillan wrote:
Show nested quote +
On April 23 2012 23:01 SirPsychoMantis wrote:
Can anyone upload some of the .s2gs files with the corrisponding basic info (like workers built and average unspent resources)? I'm at work with no access to sc2.

EDIT: Or just the file name / info, since it looks like we can request it from b.net servers

I did. Look at the page 2.


Not sure how I completely missed that, thanks. I'll do some poking.
Zerg #1
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-23 16:28:45
April 23 2012 16:24 GMT
#83
On April 22 2012 21:29 RobiTL wrote:
+ Show Spoiler +

On both replays, the AI did :
00:03 drone 7/10
00:22 drone 8/10
00:44 drone 8/10

On the first i did :
00:05 drone 7/10
00:19 drone 8/10
00:30 drone 9/10
00:49 over 9/10
00:57 drone 10/10

On the second i did :
00:02 drone 7/10
00:18 drone 8/10
00:28 drone 9/10
00:39 drone 10/10
00:56 over 10/10

I think the data of the build orders (only changes i could find in all structures) is in the 5th structure after the graphs !

Data of the first replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0x1000A, 2: 0x4900},
{ 0: 8, 1: 0x2000A, 2: 0x12F00},
{ 0: 9, 1: 0x4000A, 2: 0x1DE00},
{ 0: 10, 1: 0x7000A, 2: 0x38C00}],
[{ 0: 7, 1: 0xA, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 9, 1: 0x6000A, 2: 0x31600}],
[{ 0: 8, 1: 0x5000A, 2: 0x2C400}],


Data of the second replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0xA, 2: 0x1C00},
{ 0: 8, 1: 0x2000A, 2: 0x11C00},
{ 0: 9, 1: 0x4000A, 2: 0x1C400},
{ 0: 10, 1: 0x5000A, 2: 0x27600}],
[{ 0: 7, 1: 0x1000A, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 10, 1: 0x7000A, 2: 0x37800}],
[{ 0: 8, 1: 0x6000A, 2: 0x2C400}],


Edit : I put values of 1: and 2: in Hexadecimal, its easier to get values like this

I think 0x84 is for drones, 0x86 for overlords
the 0: is the supply (7,8,9,10)
the 1: not sure... the ending A might be the total supply (10)
the 2: I think is the time where
0x1C = 00:02
0x32 = 00:03
0x49 = 00:05
0x11C = 00:18
0x12F = 00:19
0x167 = 00:22
0x1C4 = 00:28
0x1DE = 00:30
0x276 = 00:39
0x2C4 = 00:44
0x316 = 00:49
0x378 = 00:56
0x38C = 00:57

anyone to get the general formula ?

Edit : Found ! i's in 16th of seconds !
0x1DE = 478 and 478/16 = 29.875 so 00:30




How's it going? I've been trying to parse it but it seems to be incomplete.. Some units are missing.

Also, any idea what the 2nd structure contains?
Lots of entries like this:
{  0: '',
1: { 0: 999, 1: 33554453},
2: { 0: { 0: 0, 1: 1, 2: 140},
1: 0,
2: { 0: 2, 1: 390, 2: 910, 3: 64, 4: 64}},
3: [{ 0: { 0: 999, 1: 67108869}, 1: 0}],
4: 4,
5: 0}
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 24 2012 02:18 GMT
#84
After carefully recording the times of various actions I took in the SC2 client, and comparing to the timestamps of files in my Cache, I don't think any of the files in the Cache contain a usable reference to an s2gs file.

Try it yourself! If any of you are trying this on OS X I'd be happy to share the command I used for retrieving the cache files in timestamp order.

In particular what you should try is pulling up a friend's profile, then their Match History, then hover your mouse over the magnifying glass, and then click on the match. What I found, and let me know if you find differently, if you do it carefully and make a note of the times of your actions, is that the s2gs is retrieved when you hover your mouse over the magnifying glass. Prior to that, nothing else you've done with the friend causes any files to be retrieved into the cache.

To me, this strongly implies that the s2gs filename must be being sent over the wire, but not stored in any cache file.
card-carrying grubby fan. developer of GGTracker.
Fyrn
Profile Joined April 2011
Germany62 Posts
April 24 2012 04:44 GMT
#85
On April 24 2012 11:18 dsjoerg wrote:
To me, this strongly implies that the s2gs filename must be being sent over the wire, but not stored in any cache file.


Not only that, but the HTTP requests to *.depot.battle.net are also part of the general Battle.net 2.0 protocol. Authentication and Warden utilize that CDN in all current Blizzard games. The only thing obviously referenced are the map information files that are in the index. As I said above, dangerous territory to get into. Let's find a blizzard rep, a blunt object and get an official API from him
"I mean I could always win MLG Providence next year.." - The Little One
RobiTL
Profile Joined July 2010
France55 Posts
April 25 2012 08:17 GMT
#86
I just tought about this : imagine if you could at the start of a ladder game get all your opponent previous build orders of his match history against your race with s2gs files, you could metagame your opponent lol. (oh your last 5 games against my race you did fast expand, then i will fast expand too).
Born to be Zerg
Gibybo
Profile Joined May 2007
United States229 Posts
Last Edited: 2012-04-27 10:45:09
April 27 2012 10:42 GMT
#87
I made a hacky prototype demonstrating how to get the hash files and automating a little of the SC2 client. It's a windows C#.NET app that takes a character name and code as input, and outputs the .s2gs file locations for their last 50 games.

Demo:


Source: https://github.com/gibybo/S2GS-Extractor

Obviously I don't expect people to actually use the tool by itself, but you can take the code from it and perhaps expose a web service interface to it or integrate it with other tools etc.

The client automation is a very brittle proof of concept - it requires that SC2 be run in windowed mode and positioned in the top left of your screen. If the client lags more than it expects, it'll get confused since it doesn't bother trying to figure out what state the client is in before moving to the next step. Adding that functionality wouldn't be hard, you could just take samples of critical regions of the screen and compare average color values, for example.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 10:46 GMT
#88
Nice. But how does it trigger the download? By just looking at the match history?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 11:11 GMT
#89
On April 27 2012 19:46 Prillan wrote:
Nice. But how does it trigger the download? By just looking at the match history?


Yes. Just to clarify though, the download in this case is a ~5 kilobyte payload that just has references to the .s2gs files on their CDN. To download the actual s2gs files, you'd still have to make the http requests (which is fast and trivial so I didn't include it).
treekiller
Profile Joined July 2010
United States236 Posts
April 27 2012 11:20 GMT
#90
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.
All good things must come to an end. Therefore, SC2 will last forever
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 11:54 GMT
#91
On April 27 2012 20:11 Gibybo wrote:
Show nested quote +
On April 27 2012 19:46 Prillan wrote:
Nice. But how does it trigger the download? By just looking at the match history?


Yes. Just to clarify though, the download in this case is a ~5 kilobyte payload that just has references to the .s2gs files on their CDN. To download the actual s2gs files, you'd still have to make the http requests (which is fast and trivial so I didn't include it).

Ok, looked at the source. How did you know where in the memory to look? ^^

On April 27 2012 20:20 treekiller wrote:
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.

No, actually you can't.
Stats not possible to get from replays (might be a incomplete list):
* Resource Collection Rate
* Average Unspent Resources
* Workers Created (you can get pretty close with the replay)
* Army Value over time (graph)
* Income over time (graph)
* Units Killed
* Structures Razed
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 12:05 GMT
#92
On April 27 2012 20:54 Prillan wrote:

Ok, looked at the source. How did you know where in the memory to look? ^^


Well I had a basic understanding of how the client caches the interface data in memory from when I was pulling ladder data from it for starcraftrankings.com - the rest was just taking hex dumps/diffing them/guessing and checking a little. This data was particularly easy since they always have an 8 byte prefix and all you have to do is take the 32 bytes immediately following it.
slmw
Profile Blog Joined October 2010
Finland233 Posts
April 27 2012 13:21 GMT
#93
On April 27 2012 20:20 treekiller wrote:
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.

Nope. A replay file contains only the match information (players, maps, etc.) and user input actions. It does not contain any processed information about the game itself.

Spending, resource collection rate and the other info in score screen all require SC2 game engine to be calculated accurately. The replay data contains a lot of noise and simulating even the simplest things, such as build order from replay is pretty much impossible to do without running SC2.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 13:22 GMT
#94
On April 27 2012 21:05 Gibybo wrote:
Show nested quote +
On April 27 2012 20:54 Prillan wrote:

Ok, looked at the source. How did you know where in the memory to look? ^^


Well I had a basic understanding of how the client caches the interface data in memory from when I was pulling ladder data from it for starcraftrankings.com - the rest was just taking hex dumps/diffing them/guessing and checking a little. This data was particularly easy since they always have an 8 byte prefix and all you have to do is take the 32 bytes immediately following it.


I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 27 2012 13:25 GMT
#95
Gibybo, that prototype is red-hot. Nice work!
card-carrying grubby fan. developer of GGTracker.
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 18:38 GMT
#96
On April 27 2012 22:22 Prillan wrote:
I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)


Thanks for the pull request, merged! Meh, the code is already separate enough to just do the memory reading if you want (just comment out the call to SC2Macros.openMatchHistory()). You should add the support for sending the http requests if you want
it

On April 27 2012 22:25 dsjoerg wrote:
Gibybo, that prototype is red-hot. Nice work!


Thanks
zachMEISTER
Profile Joined December 2010
United States625 Posts
April 27 2012 19:09 GMT
#97
This is revolutionary! I can't wait until you guys have hammered out a basic interface capable of pulling substantial stats!
psillypsybic!
Cuce
Profile Joined March 2011
Turkey1127 Posts
April 27 2012 20:48 GMT
#98
http://classic.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Northrend&PlayerName=MarkLovesYou

this is rank 1 in northrend ladder wc3 player. I dont know him just picked the rank 1. the thing is I wish sc2 had this much statistics per player.

build orders, duration per map, duration per map agains races, xp per sec per map, avarage lvl of heroes per map and list goes on
64K RAM SYSTEM 38911 BASIC BYTES FREE
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-28 12:33:53
April 28 2012 11:52 GMT
#99
On April 28 2012 03:38 Gibybo wrote:
Show nested quote +
On April 27 2012 22:22 Prillan wrote:
I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)


Thanks for the pull request, merged! Meh, the code is already separate enough to just do the memory reading if you want (just comment out the call to SC2Macros.openMatchHistory()). You should add the support for sending the http requests if you want
it

Show nested quote +
On April 27 2012 22:25 dsjoerg wrote:
Gibybo, that prototype is red-hot. Nice work!


Thanks

More edits!

It's useful now

@dsjoerg I saw that you pushed stuff to sc2reader. Want some help? I can parse some data I you want.

EDIT:
@Graylin Could you add me to https://github.com/GraylinKim/sc2reader ?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 28 2012 12:45 GMT
#100
@Prillan I'd love some help! Anyone else who wants to help is welcome, sc2reader is an open project.

I'm particularly excited to get player identities, game start or end time, and an identifier for the map.

But really anything people want to add would be great.
card-carrying grubby fan. developer of GGTracker.
Prev 1 2 3 4 5 6 7 Next All
Please log in or register to reply.
Live Events Refresh
OSC
00:00
OSC Elite Rising Star #15
Jumy vs NicoractLIVE!
xJustxJordanx22
Liquipedia
Replay Cast
00:00
SEL S2 Last Chance Qualifier 1
CranKy Ducklings113
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 214
SpeCial 164
RuFF_SC2 111
CosmosSc2 29
feardragon 11
StarCraft: Brood War
Sharp 72
Bale 24
Icarus 11
Dota 2
monkeys_forever950
Counter-Strike
Stewie2K843
Other Games
summit1g13150
tarik_tv7915
shahzam1216
JimRising 429
ViBE233
NeuroSwarm136
Trikslyr72
Organizations
Other Games
gamesdonequick2459
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH230
• Hupsaiya 66
• practicex 4
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Scarra2232
• Rush1103
Upcoming Events
Epic.LAN
9h 37m
Big Brain Bouts
13h 37m
sebesdes vs SpeCial
Harstem vs YoungYakov
GgMaChine vs uThermal
CranKy Ducklings
1d 7h
Epic.LAN
1d 9h
CSO Contender
1d 14h
BSL20 Non-Korean Champi…
1d 15h
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
2 days
Online Event
2 days
BSL20 Non-Korean Champi…
2 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Esports World Cup
4 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
[ Show More ]
Esports World Cup
5 days
Esports World Cup
6 days
Liquipedia Results

Completed

JPL Season 2
RSL Revival: Season 1
Murky Cup #2

Ongoing

BSL 2v2 Season 3
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.