• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:39
CET 16:39
KST 00:39
  • 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
Master's Coliseum 8: Playoffs Week 1 Preview5Master's Coliseum 8 - Group D: Oliveira, Clem, Zoun, Spirit4Team Liquid Map Contest #20 - Presented by Monster Energy30Master's Coliseum 8 - Group B: MaxPax, Reynor, Rogue, SKillous2Master's Coliseum 8 - Group A: Serral, SHIN, Astrea, Cure10
Community News
Weekly Cups (Jan 6-12): Clem/MaxPax/herO win, Serral loses showmatch3OSC Season 12 World Championship1uThermal 2v2 Circuit8Last Chance Qualifiers for OlimoLeague 2024 Winter1Oliveira/TIME retires20
StarCraft 2
General
If the ESL tour is discontinued, how much are you willing to spend per year to support SC2 esports? (crowdfunding, stream subscriptions, donations, etc.) Weekly Cups (Jan 6-12): Clem/MaxPax/herO win, Serral loses showmatch A totally unpatched clean install of WoL possible? Oliveira/TIME retires Master's Coliseum 8: Playoffs Week 1 Preview
Tourneys
$15,000 Master's Coliseum #8 - (Dec 14-Jan 19) Introducing Vancouver Sumo Starcraft II League H.4.0.S Galactic Battle Champions (18 January) uThermal 2v2 Circuit KSL + DT Events + Final Boss Fight? Lets <3 Dark!
Strategy
[G]: How to Write a Help[H] or Question[Q] Thread [G] Writing Build Order Guides
Custom Maps
Simple Questions/Answers Mod: Observer PlusPlus Cyclone
External Content
Mutation # 456 Ulnar New Year Mutation # 455 Shield Up! Mutation # 454 Cremation Mutation # 453 The Ultimate Price
Brood War
General
BGH auto balance -> http://bghmmr.com/ English Translation Question StarCraft & BroodWar Campaign Speedrun Quest Why protoss always underperforms on pro level? New SSL2 Candidate maps~
Tourneys
[Megathread] Daily Proleagues The Casual Games of the Week Thread Red Clan Cup 28 BWCL Season 61 Wrap-Up/S62 Announcement
Strategy
4 guys on gas Muta harass in zvt [G] Mineral Boosting Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile MLG Halo Discussion Nintendo Switch Thread Transformice
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
WORLDS 2024
Heroes of the Storm
Simple Questions, Simple Answers
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Elon Musk's lies, propaganda, etc. Awesome Games Done Quick 2025! Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
fOrGG/Fin Fan Club Serral Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread [Manga] One Piece [Books] Epic-Fantasy series discussion thread Korean Music Discussion
Sports
2024 - 2025 Football Thread TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
The Automated Ban List
Blogs
FPS vs. RTS: Cognitive Abili…
TrAiDoS
I made a Card Game (Deck …
LUCKY_NOOB
Aizen's message from the…
sosukeAiZEN
Inconsistent DPS? can som…
StaticNine
Crime in Fribourg!
Nebuchad
Eight Anniversary as a TL…
Mizenhauer
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3437 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
OSC
15:20
Season 12 World Championship
YoungYakov vs SKillousLIVE!
Nicoract vs TBD
NightMare vs ReBellioN
Cure vs Creator
WardiTV1219
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 103
Rex 96
StarCraft: Brood War
Shuttle 3427
Mini 1207
ZerO 957
BeSt 783
Hyuk 488
Light 459
actioN 363
Snow 346
hero 180
Rush 137
[ Show more ]
firebathero 135
Leta 126
sorry 60
Barracks 56
Shinee 49
Terrorterran 30
Movie 26
HiyA 25
sSak 24
ToSsGirL 23
ajuk12(nOOB) 18
Rock 15
IntoTheRainbow 15
Sexy 14
Sacsri 13
JulyZerg 13
scan(afreeca) 10
Backho 7
Bale 5
Stormgate
RushiSC24
Dota 2
Gorgc11284
qojqva3464
Dendi1174
XcaliburYe407
syndereN91
febbydoto3
Counter-Strike
zeus1444
byalli243
nookyyy 104
Other Games
hiko876
Hui .362
Lowko304
Fuzer 177
Liquid`VortiX127
ArmadaUGS104
kaitlyn64
Mew2King62
amsayoshi41
ZerO(Twitch)34
Organizations
Other Games
gamesdonequick6373
StarCraft 2
ESL.tv111
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 19 non-featured ]
StarCraft 2
• StrangeGG 25
• intothetv
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• Laughngamez YouTube
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• blackmanpl 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2632
• WagamamaTV535
League of Legends
• Nemesis3037
• Jankos2016
• PePiiNeRO1540
• TFBlade1021
Upcoming Events
PiGosaur Monday
9h 22m
OlimoLeague
19h 22m
LiuLi Cup
20h 22m
SKillous vs Solar
MaxPax vs SHIN
OSC
1d
Replay Cast
1d 8h
LiuLi Cup
1d 20h
Clem vs Krystianer
Dark vs Jieshi
OSC
2 days
OSC
2 days
The PondCast
2 days
Master's Coliseum
2 days
herO vs Reynor
MaxPax vs Serral
[ Show More ]
OSC
2 days
OSC
3 days
Master's Coliseum
3 days
Astrea vs TBD
GuMiho vs TBD
H.4.0.S
4 days
Master's Coliseum
4 days
Chat StarLeague
5 days
Replay Cast
5 days
Master's Coliseum
5 days
Chat StarLeague
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-01-03
HSC XXVI
Bitka W Nexusie

Ongoing

KCM Race Survival 2024 Season 5
Top Gun of StarCraft Season2
CSL 15: 2024 Winter
OSC Championship Season 12
LiuLi Cup: 2024 Grand Finals
Master's Coliseum 8
PW Shanghai Major 2024
ESL Impact League Season 6
Shanghai Major: EU RMR B
Shanghai Major: EU RMR A
Shanghai Major: AMER RMR
BLAST Premier World Final
Thunderpick World Champ.

Upcoming

2025 SCS SPRING: Qualifier
2025 SCS SPRING
Platinum Anchor Qualifying S3
HSC XXVII
Bellum Gens Elite Stara Zagora 2025
BLAST Open Spring 2025
ESL Pro League S21
Skyesports Souvenir 2025
PGL Cluj-Napoca 2025
IEM Katowice 2025
BLAST Bounty Spring 2025
ECL Season 49: Europe
BLAST Bounty Spring 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.