• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:21
CEST 16:21
KST 23:21
  • 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 Season 1 - Final Week8[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Weekly Cups (July 14-20): Final Check-up0Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission re-extension4Firefly given lifetime ban by ESIC following match-fixing investigation17
StarCraft 2
General
Who will win EWC 2025? Magnus Carlsen and Fabi review Clem's chess game. Why doesnt SC2 scene costream tournaments RSL Season 1 - Final Week How does the number of casters affect your enjoyment of esports?
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame
Brood War
General
BW General Discussion Corsair Pursuit Micro? BGH Auto Balance -> http://bghmmr.eu/ Pro gamer house photos Flash Announces (and Retracts) Hiatus From ASL
Tourneys
[Megathread] Daily Proleagues [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET The Casual Games of the Week Thread BWCL Season 63 Announcement
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread [MMORPG] Tree of Savior (Successor of Ragnarok) Path of Exile CCLP - Command & Conquer League Project
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread The Games Industry And ATVI Stop Killing Games - European Citizens Initiative
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 798 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
Next event in 19h 39m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mcanning 309
StarCraft: Brood War
Flash 3502
Barracks 3469
Jaedong 3066
BeSt 1410
Mini 1298
EffOrt 1004
Soma 686
Larva 529
Stork 454
firebathero 372
[ Show more ]
Snow 341
Free 198
Hyun 141
Rush 137
Backho 85
Mind 80
Pusan 66
ZerO 58
Sharp 57
TY 55
ToSsGirL 54
sas.Sziky 48
sorry 47
soO 45
Movie 35
Shinee 33
zelot 32
scan(afreeca) 22
Bale 17
Terrorterran 15
sSak 14
SilentControl 9
Shine 8
Yoon 8
ivOry 3
Dota 2
syndereN643
XcaliburYe349
420jenkins307
League of Legends
Dendi1203
Counter-Strike
ScreaM1681
markeloff86
Other Games
singsing2970
B2W.Neo1649
hiko1469
crisheroes470
Liquid`VortiX88
ZerO(Twitch)26
Rex20
KnowMe6
Organizations
StarCraft: Brood War
lovetv 12
Kim Chul Min (afreeca) 7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV493
League of Legends
• Nemesis6124
Upcoming Events
Esports World Cup
19h 39m
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Esports World Cup
1d 19h
Esports World Cup
2 days
Esports World Cup
3 days
CranKy Ducklings
4 days
BSL20 Non-Korean Champi…
4 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
FEL
5 days
BSL20 Non-Korean Champi…
5 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

CSL Xiamen Invitational
Championship of Russia 2025
Murky Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
CC Div. A S7
Underdog Cup #2
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
HCC Europe
ESL Pro League S22
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
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.