• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 13:10
CET 19:10
KST 03:10
  • 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
Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3
Community News
Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win62025 RSL Offline Finals Dates + Ticket Sales!10BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION3Crank Gathers Season 2: SC II Pro Teams12
StarCraft 2
General
Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly RotterdaM "Serral is the GOAT, and it's not close" Intel X Team Liquid Seoul event: Showmatches and Meet the Pros Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win Weekly Cups (Oct 13-19): Clem Goes for Four
Tourneys
SC4ALL $6,000 Open LAN in Philadelphia $3,500 WardiTV Korean Royale S4 Crank Gathers Season 2: SC II Pro Teams Merivale 8 Open - LAN - Stellar Fest Kirktown Chat Brawl #9 $50 8:30PM EST
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
SnOw on 'Experimental' Nonstandard Maps in ASL Ladder Map Matchup Stats SnOw's ASL S20 Finals Review Map pack for 3v3/4v4/FFA games BW General Discussion
Tourneys
BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION [ASL20] Grand Finals Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
How to stay on top of macro? Current Meta PvZ map balance Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Stormgate/Frost Giant Megathread General RTS Discussion Thread Path of Exile
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Dating: How's your luck? Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion 2024 - 2026 Football Thread NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
What is "Original Sin"?
Peanutsc
Challenge: Maths isn't all…
Hildegard
Career Paths and Skills for …
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1671 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
Monday Night Weeklies
17:00
Monday Night Weekly #29
RotterdaM633
TKL 307
IndyStarCraft 161
BRAT_OK 84
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 619
TKL 293
IndyStarCraft 161
BRAT_OK 84
UpATreeSC 79
Codebar 51
ZombieGrub43
MindelVK 24
StarCraft: Brood War
firebathero 275
Mong 70
Rock 45
Dota 2
qojqva3476
420jenkins376
BananaSlamJamma189
XcaliburYe162
Counter-Strike
ScreaM1487
kRYSTAL_44
byalli0
Other Games
singsing2097
FrodaN1749
Lowko467
ceh9418
Liquid`VortiX270
Fuzer 182
ArmadaUGS161
C9.Mang094
QueenE78
Trikslyr54
Organizations
Other Games
gamesdonequick657
Counter-Strike
PGL341
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• kabyraGe 50
• Hupsaiya 37
• Adnapsc2 7
• Reevou 2
• IndyKCrew
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
StarCraft: Brood War
• Michael_bg 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV561
League of Legends
• Jankos2704
Other Games
• imaqtpie787
Upcoming Events
Replay Cast
4h 50m
Sparkling Tuna Cup
15h 50m
WardiTV Korean Royale
17h 50m
LAN Event
20h 50m
Replay Cast
1d 14h
WardiTV Korean Royale
1d 17h
LAN Event
1d 20h
OSC
2 days
The PondCast
2 days
LAN Event
2 days
[ Show More ]
Replay Cast
3 days
LAN Event
3 days
Korean StarCraft League
4 days
CranKy Ducklings
4 days
WardiTV Korean Royale
4 days
LAN Event
4 days
IPSL
4 days
dxtr13 vs OldBoy
Napoleon vs Doodle
Replay Cast
5 days
Sparkling Tuna Cup
5 days
WardiTV Korean Royale
5 days
LAN Event
5 days
IPSL
5 days
JDConan vs WIZARD
WolFix vs Cross
Replay Cast
6 days
Wardi Open
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025

Upcoming

BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 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.