• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:01
CET 06:01
KST 14:01
  • 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 Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies1ComeBackTV's documentary on Byun's Career !10Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament $100 Prize Pool - Winter Warp Gate Masters Showdow Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Klaucher discontinued / in-game color settings Anyone remember me from 2000s Bnet EAST server? How Rain Became ProGamer in Just 3 Months FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1129 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
Next event in 1d 6h
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft510
RuFF_SC2 197
SortOf 11
Ketroc 7
StarCraft: Brood War
Britney 41610
Yoon 182
ZergMaN 153
ggaemo 109
GoRush 68
sorry 61
Noble 42
Bale 11
Icarus 6
Dota 2
NeuroSwarm101
League of Legends
JimRising 575
C9.Mang0454
Trikslyr63
Counter-Strike
summit1g8128
minikerr45
Super Smash Bros
hungrybox386
Other Games
Mew2King71
Organizations
Other Games
gamesdonequick1150
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Hupsaiya 111
• practicex 40
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 21
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22306
Upcoming Events
WardiTV Invitational
1d 6h
Gerald vs YoungYakov
Spirit vs MaNa
SHIN vs Percival
Creator vs Scarlett
Replay Cast
2 days
WardiTV Invitational
2 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
3 days
Sparkling Tuna Cup
5 days
Krystianer vs TBD
TriGGeR vs SKillous
Percival vs TBD
ByuN vs Nicoract
Replay Cast
6 days
Wardi Open
6 days
Liquipedia Results

Completed

YSL S2
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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.