• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:29
CEST 03:29
KST 10:29
  • 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
Team TLMC #5 - Finalists & Open Tournaments0[ASL20] Ro16 Preview Pt2: Turbulence10Classic Games #3: Rogue vs Serral at BlizzCon9[ASL20] Ro16 Preview Pt1: Ascent10Maestros of the Game: Week 1/Play-in Preview12
Community News
StarCraft II 5.0.15 PTR Patch Notes60BSL 2025 Warsaw LAN + Legends Showmatch0Weekly Cups (Sept 8-14): herO & MaxPax split cups4WardiTV TL Team Map Contest #5 Tournaments1SC4ALL $6,000 Open LAN in Philadelphia8
StarCraft 2
General
StarCraft II 5.0.15 PTR Patch Notes #1: Maru - Greatest Players of All Time Weekly Cups (Sept 8-14): herO & MaxPax split cups Team Liquid Map Contest #21 - Presented by Monster Energy SpeCial on The Tasteless Podcast
Tourneys
SC2's Safe House 2 - October 18 & 19 RSL: Revival, a new crowdfunded tournament series Maestros of The Game—$20k event w/ live finals in Paris Sparkling Tuna Cup - Weekly Open Tournament SC4ALL $6,000 Open LAN in Philadelphia
Strategy
Custom Maps
External Content
Mutation # 491 Night Drive Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around
Brood War
General
ASL20 General Discussion Soulkey on ASL S20 BW General Discussion ASL TICKET LIVE help! :D NaDa's Body
Tourneys
[ASL20] Ro16 Group C [ASL20] Ro16 Group D Small VOD Thread 2.0 [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Borderlands 3 Path of Exile Nintendo Switch Thread General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
Community
General
UK Politics Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
BarCraft in Tokyo Japan for ASL Season5 Final The Automated Ban List
Blogs
i'm really bored guys
Peanutsc
I <=> 9
KrillinFromwales
The Personality of a Spender…
TrAiDoS
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
RTS Design in Hypercoven
a11
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1888 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 8h 31m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft415
SteadfastSC 180
RuFF_SC2 124
CosmosSc2 59
Vindicta 14
StarCraft: Brood War
Aegong 1739
Artosis 672
Shuttle 521
Light 96
NaDa 17
ajuk12(nOOB) 4
Dota 2
monkeys_forever835
NeuroSwarm174
Counter-Strike
Stewie2K558
Fnx 310
PGG 86
Super Smash Bros
C9.Mang0367
Mew2King49
Other Games
summit1g6622
shahzam926
JimRising 653
Trikslyr52
ViBE35
Nina23
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• davetesta30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 17
• Azhi_Dahaki7
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Doublelift5012
Other Games
• Scarra1062
Upcoming Events
RSL Revival
8h 31m
Zoun vs Classic
Map Test Tournament
9h 31m
Korean StarCraft League
1d 1h
BSL Open LAN 2025 - War…
1d 6h
RSL Revival
1d 8h
Reynor vs Cure
BSL Open LAN 2025 - War…
2 days
RSL Revival
2 days
Online Event
2 days
Wardi Open
3 days
Monday Night Weeklies
3 days
[ Show More ]
Sparkling Tuna Cup
4 days
LiuLi Cup
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2025-09-10
Chzzk MurlocKing SC1 vs SC2 Cup #2
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
RSL Revival: Season 2
Maestros of the Game
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
FISSURE Playground #1

Upcoming

2025 Chongqing Offline CUP
BSL World Championship of Poland 2025
IPSL Winter 2025-26
BSL Season 21
SC4ALL: Brood War
BSL 21 Team A
Stellar Fest
SC4ALL: StarCraft II
EC S1
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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.