• 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 3

Forum Index > SC2 General
Post a Reply
Prev 1 2 3 4 5 6 7 Next All
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 14:57 GMT
#41
On April 22 2012 23:39 Aelfric wrote:
I think it can be implemented in sc2gears or some program to create that file for every auto saved replay after the update.


This file is downloaded from the bnet depots. Someone could packet sniff their computer and get the request URL. From there it will probably be possible to automatically download the S2GS files at will based on information from the replay.

I am fairly confident saying this because that is how map downloading currently works. You can grab the exact map file game was played on from the replay file via bnet.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-22 15:13:06
April 22 2012 15:04 GMT
#42
On April 22 2012 23:57 ShadesofGraylin wrote:
Show nested quote +
On April 22 2012 23:39 Aelfric wrote:
I think it can be implemented in sc2gears or some program to create that file for every auto saved replay after the update.


This file is downloaded from the bnet depots. Someone could packet sniff their computer and get the request URL. From there it will probably be possible to automatically download the S2GS files at will based on information from the replay.

I am fairly confident saying this because that is how map downloading currently works. You can grab the exact map file game was played on from the replay file via bnet.

I'm on it!

EDIT:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
deo1
Profile Joined April 2010
United States199 Posts
April 22 2012 15:18 GMT
#43
*looks down on nerd army*

Yes yes, continue working.

*ascends back into the internet*
Poooooor Protoss.
thurst0n
Profile Blog Joined December 2010
United States611 Posts
April 22 2012 15:28 GMT
#44
Nerds unite! This is just simply amazing. Not only the work itself but the collaboration! Yay Go Team Nerd!
P.S. I'm nub. If you'd like you can follow me @xthurst but its not worth it ill be honest
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 15:30 GMT
#45
On April 23 2012 00:04 Prillan wrote:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?


Awesome. Can you supply a set of replay files and their corresponding .s2gs hashes?

It'd help to have a common set of data for everyone to be working with, possibly with screenshots of the score screens as well. Ideally a mix of 1v1,2v2,4v4, FFA games to see how/if the player count affects the structure.

I haven't booted SC in weeks so this would be particuarly helpful to me...
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 15:38 GMT
#46
On April 23 2012 00:30 ShadesofGraylin wrote:
Show nested quote +
On April 23 2012 00:04 Prillan wrote:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?


Awesome. Can you supply a set of replay files and their corresponding .s2gs hashes?

It'd help to have a common set of data for everyone to be working with, possibly with screenshots of the score screens as well. Ideally a mix of 1v1,2v2,4v4, FFA games to see how/if the player count affects the structure.

I haven't booted SC in weeks so this would be particuarly helpful to me...


Sure, I need to structure my work a bit first.. It's a mess ^^

Do anyone know how the map hash is calculated?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 15:46 GMT
#47
On April 23 2012 00:38 Prillan wrote:
Do anyone know how the map hash is calculated?


The map hash is stored in the replay.initData file in the .SC2Replay MPQ archive. We don't calculate it, we just use it. The initData file actually stores a bunch of resource identifiers but none of them (that I know of) are this .s2gs file though so it is probably stored elsewhere.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 16:06 GMT
#48
On April 23 2012 00:46 ShadesofGraylin wrote:
Show nested quote +
On April 23 2012 00:38 Prillan wrote:
Do anyone know how the map hash is calculated?


The map hash is stored in the replay.initData file in the .SC2Replay MPQ archive. We don't calculate it, we just use it. The initData file actually stores a bunch of resource identifiers but none of them (that I know of) are this .s2gs file though so it is probably stored elsewhere.


Sad news: The hash is actually the SHA-256 hash of the file itself.

I'm trying to find some kind of index file to grab from the same source.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 16:09 GMT
#49
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
thurst0n
Profile Blog Joined December 2010
United States611 Posts
April 22 2012 16:13 GMT
#50
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."
P.S. I'm nub. If you'd like you can follow me @xthurst but its not worth it ill be honest
looknohands119
Profile Joined March 2010
United States815 Posts
April 22 2012 16:20 GMT
#51
This is really great work guys!
"The kingdom of the heavens is buried treasure. Would you sell yourself to buy the one you've found?" - Jon Foreman ('Your Love Is Strong' - Spring EP)
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 16:34 GMT
#52
On April 23 2012 01:13 thurst0n wrote:
Show nested quote +
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."

Yeah, that's not the problem ^^

We wanted to find a way to calculate the hash so we could download the file given a replay. Now we can only use new .s2gs files and those already in the Cache folder. The other ones are lost forever
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 16:35 GMT
#53
On April 23 2012 01:13 thurst0n wrote:
Show nested quote +
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."


The issue of correlating two files is different from the issue of using one file to get the other.

The two files might both have identical player/time/initdata information that allows us to definitively say that the two files we have are for the same replay. That information is certainly useful but requires that we have physically obtained a copy of each file.

It is a different issue to find one file given that we have the other. Since we know how to grab replay files easily, the issue becomes grabbing the s2gs file from the replay file. If files are named according to a hash of their contents (not reproducable without the file), the only way we could find one from the other is if there were embedded links. Map files for instance, have their id embedded in the replay file for retrieval at a later point.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
JOJOsc2news
Profile Blog Joined March 2011
3000 Posts
April 22 2012 16:50 GMT
#54
Great work. I don't know enough to meaningfully contribute to the work but I can say that you are doing a great job.

Implementing the findings into programs like SC2Gears would be amazing for even more replay and multiple replay analysis.
Thanks for the good work and I hope you can figure it all out.
✉ Tweets @sc2channel ⌦ Blog: http://www.teamliquid.net/blog/JOJO ⌫ "Arbiterssss... build more arbiterssss." Click 'Profile' for awesome shiro art!
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 17:41 GMT
#55
I don't think the s2gs hash is in the replay, or computable from the replay. Think about how the SC2 client works. There must be some kind of "player profile" data that the SC2 client retrieves, which must contain a list-like data structure of the Match History. Inside the Match History there must be information for the games that are shown on the Match History. Inside the data for a match must be the s2gs filename.

I expect that only wiresharking will tell us for sure.
card-carrying grubby fan. developer of GGTracker.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 17:53 GMT
#56
On April 23 2012 02:41 dsjoerg wrote:
I don't think the s2gs hash is in the replay, or computable from the replay. Think about how the SC2 client works. There must be some kind of "player profile" data that the SC2 client retrieves, which must contain a list-like data structure of the Match History. Inside the Match History there must be information for the games that are shown on the Match History. Inside the data for a match must be the s2gs filename.

I expect that only wiresharking will tell us for sure.

I've done that and didn't find anything interesting. I haven't found any other interesting file in the Cache folder which contains anything close to a list of s2gs files
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 17:56 GMT
#57
Searching through hexdumps of the replay datafiles confirms that there isn't an explicit reference in the replay file.

Also, I agree with your analysis @dsjoerg. Wireshark can provide us with the URLs we need to simulate moving through the client application. I'd suspect that most of the files will be in the same serialized data format. Not sure how much Blizzard would appreciate our pinging of their data servers but I suppose we can find out the hard way.

@Prillan want to track down some of the other data feeds triggered by the profile GUI?
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 18:02 GMT
#58
Prillan, although the "player profile" may not be in the Cache file, it must be transmitted over the wire to the SC2 client... otherwise it wouldn't know s2gs filename to request.
card-carrying grubby fan. developer of GGTracker.
Torpedo.Vegas
Profile Blog Joined January 2011
United States1890 Posts
April 22 2012 18:14 GMT
#59
I can see this ending up in the formations of Liquid's Eleven. A grand heist to get Blizzards data.
whatthefat
Profile Blog Joined August 2010
United States918 Posts
April 22 2012 18:20 GMT
#60
Amazing find!
SlayerS_BoxeR: "I always feel sorry towards Greg (Grack?) T_T"
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.