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