Download SoV for Windows
Download SoV for Mac OS X
Github project page
Ever wanted to play Starcraft with a friend who is behind a VPN (like OpenVPN) but the game just didn’t appear in the UDP local network list ?
This tool is meant to start UPD LAN games even over VPN. The problem is that VPNs don’t forward and translate broadcast UDP packets.
It works by using libPcap to intercept such broadcast packets from starcraft and injecting them into the VPNs interface. Your partner (who created the game) sees your broadcast packet, replies, and you see his game appear in your list. (Starcraft doesn’t use broadcast UDP after that, so once you have joined the game, you can quit SoV, or just ignore it)
Because this forwards any broadcast packet according to parameters, this may work with any game/service discovery and other similar UPD-broadcast based protocols
Please be advised, using this tool is a bit complicated, and it requires some understanding of IP. Sorry about that…
Downloads
Instructions
The principle is simple:
- You connect to the same VPN as your friend, and check that you can ping each other
- He starts StarCraft, creates the game and waits at the Game Lobby screen
- You start StarCraft, and go to the Game Selection screen
- You run SoV, and return to starcraft
- You now see the game and can join and play
- hfgl
If you are running Windows, please scroll down.
If you are running Mac OS X, please follow the instructions for Mac OS X.
Windows
1) Installation - Finding your interfaces
- Download WinPcap and install it
- Download SoV for Windows and install it
- Open a command prompt as administrator and cd into the folder with SoV.exe
- Type
SoV /L
c:\SoV_2_win32\>SoV /L Here is a list of active accessible interface names : \Device\NPF_{3C8154E6-F470-48E4-892B-EEB8B3C881A4} Description: Intel(R) 82566DC-2 Gigabit Network Connection (Microsoft's Packet Scheduler) 10.0.0.30 mask: 255.255.255.0 cast: 255.255.255.255 gate: n/a \Device\NPF_{88984140-205F-4A82-91CB-0B57246ACD18} Description: TAP-Win32 Adapter V9 (Microsoft's Packet Scheduler) 192.168.10.6 mask: 255.255.255.252 cast: 255.255.255.255 gate: n/a
Finding your interface names:
In the interface listing above, in blue and with a box around them, are the name of the devices. You will need to write down 2 devices, which you should recognise using the IP address displayed:
-
lan_dev: This is a normal lan device. Any active ethernet or wifi will do.
You need this because this is how SoV will find StarCraft's packets. -
vpn_dev: This is the VPN device, it might or not be a VPN, the point is, it is how you reach the game creator. You do not need this for the UDP methods, but you do for the injection method.
2) Check connectivity
-
Find out the IP address of the game creator, lets say its
192.168.10.7
-
Type
ping 192.168.10.7
(and get him to ping you) -
Troubleshooting
- Have you both deactivated any firewalls ?
- Check the VPNs routing and troubleshooting documentation
- Windows traditional debuggin: Retry, Reboot, Reinstall
3) Start the games
- Start the game, this might be a good time to check the StarCraft version of both players match. (here — have a link to patch 1.16.1)
- Please note that you must both use UDP multiplayer mode
- Tell the game host to create the game and wait at the Game Lobby screen
- In your StarCraft, go to the Game Selection screen
(this is important, or you wont be broadcasting “_Are there any games created?_” packets) - Press Alt+Tab (or Cmd + M on Mac OS X) to return to the command line
4.a) Running in UDP RAW mode
- Run SoV lan_dev creator_ip
c:\SoV_2_win32\>SoV \Device\NPF_{3C8154E6-F470-48E4-892B-EEB8B3C881A4} 192.168.10.7 Running... Press CTRL+C to stop. Captured : 7 sent: 7 errors: 0
- Now watch a bit the numbers in blue and with a box around them. Make sure they increase. If they dont, make sure your StarCraft is at the game selection screen.
- If the numbers increase, check that you see the game, if you do, you can join and play, thats all there is to it.
- If the game doesnt show, there are errors, or something, try troubleshooting, or try the UDP Bound method
4.b) Running in UDP Bound mode
-
Pretty much the same as
UDP RAW,
except add the
/bind
switch : -
Run
SoV /bind lan_dev creator_ip
c:\SoV_2_win32\>SoV /bind \Device\NPF_{3C8154E6-F470-48E4-892B-EEB8B3C881A4} 192.168.10.7 Running... Press CTRL+C to stop. Captured : 7 sent: 7 errors: 0
- Same thing, if it works, play and enjoy, if it doesnt, there is the injection method
4.c) Running in Injection mode
( This is quite different on Mac OS X, see Mac OS X Injection Mode .)
Ok, now this will be a major PIA, but we can try. The trouble is that we have to rebuild much of the packet, and because were cheating, we have no help. Someone can write this better Im sure. Here goes.
- First off, we need the ethernet MAC address of the VPNs interface card, and of the next hop for packets going to your game creator.
-
Run
SoV /f "icmp" /pc vpn_dev creator_ip
In the meantime, open a second command prompt, and runping creator_ip
.
c:\SoV_2_win32\>SoV /f "icmp" /pc \Device\NPF_{88984140-205F-4A82-91CB-0B57246ACD18} 192.168.10.7 Running... Press CTRL+C to stop. Captured : 0 sent: 0 errors: 0 Got packet: =ethe: from 00:FF:88:98:41:40 to 00:FF:89:98:41:42 = ip: from 192.168.10.6 to 192.168.10.7 =icmp: type 8 (code 0) ... may be some more, stop it at this point with CTRL + C ...
-
In the packet listing above, find a packet, and note the MAC addresses (in blue and with a box around them).
Check with the next line which is which by looking at the IP:
- mac_vpn: This is the MAC address that matches your IP.
- mac_hop: This is the other MAC address.
Explanation ( you can safely skip reading this )
We set SoV to:
- Intercept all icmp traffic:
/f "icmp"
- Print out captured packets:
/pc
Which makes its intercept, decode and print out packets, and so should find pings packets (
type 8
), and tell you how you are routing them.Of course, this mode is useless for anything else.
- Run SoV lan_dev /i vpn_dev creator_ip /esrc mac_vpn /edst mac_hop
c:\SoV_2_win32\>SoV \Device\NPF_{3C8154E6-F470-48E4-892B-EEB8B3C881A4} /i \Device\NPF_{88984140-205F-4A82-91CB-0B57246ACD18} 192.168.10.7 /esrc 00:FF:88:98:41:40 /edst 00:FF:88:98:41:42 Running... Press CTRL+C to stop. Captured : 5 sent: 5 errors: 0
- Same thing, if it works, play and enjoy, if it doesnt, please try further troubleshooting
Mac OS X
1) Installation - Finding your interfaces
-
Make sure you have
libpcap
installed.If not, using MacPorts, run
sudo port install libpcap
-
Download Download SoV for Mac OS X, unzip it somewhere, then flag it executable:
~ $ mkdir sov && cd sov ~/sov $ curl -O http://s-softs.com/Projects/SoV/SoV_2_osx.zip % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4706 100 4706 0 0 14007 0 --:--:-- --:--:-- --:--:-- 20460 ~/sov $ unzip SoV_2_osx.zip Archive: SoV_2_osx.zip inflating: sov ~/sov $ chmod +x sov # make it executable :)
-
Type
sudo ./sov -l
\~/sov $ sudo ./sov -l Here is a list of active accessible interface names : en0 10.0.0.40 mask: 255.255.255.0 cast: 10.0.0.255 gate: n/a tun0 192.168.10.1 mask: 255.255.255.255 cast: n/a gate: 192.168.10.2 en1 10.0.0.41 mask: 255.255.255.0 cast: 10.0.0.255 gate: n/a lo0 127.0.0.1 mask: 255.0.0.0 cast: n/a gate: n/a
- The only difference is that \Device\.... long thing looks like en0, and that you should always sudo the commands !.
- So go on to step Finding your interfaces !
4.c) Injection Mode
No need to do the whole ethernet MAC address kung-fu:
-
Run
sudo ./sov lan_dev -i vpn_dev creator_ip
~/sov $ sudo ./sov en1 -i tun0 192.168.10.7 Password: Running... Press CTRL+C to stop. Captured : 1 sent: 1 errors: 0
Same thing: if it works, play and enjoy, if it doesnt, please try further troubleshooting
Switches
- All switches are case insensitive.
- They may be used with either
-
or/
, but only one switch per argument - Switches that use arguments must have their argument as the immediate next parameter.
- This list might become obsolete. For reference run
SoV /help
Switch | Argument | Description |
---|---|---|
-p | port |
Set interception and forwarding target port
default: 6111 |
-f | pcap filter |
Force PCap filter to a specific value. Format described in
man pcap-filter
(cheatsheets)
default: udp port 6111 and dst net 255.255.255.255 |
-bind | Use bound UDP socket to forward packets. See 4.b. | |
-i | device_name | Inject packets into specified device using PCap (instead of UDP socket). See 4.c. |
-esrc -edst |
MAC in hex eg: 11:22:33:44:55:AA |
Windows only. Set source and destination MAC address to use when injecting packets. |
-nost | Dont print packet statistics | |
-pc | Print captured packets summary details | |
-pr | Print captured packets summary details and hex dump of raw contents | |
-v | Activate verbose mode. Output more about what SoV is doing. | |
-L | List available interfaces and exit. | |
-h | Show the list of options and exit. | |
-ver | Show version information and exit. |
Troubleshooting
-
If you dont see packets being caught:
- Are you sure your lan_dev is active and has an IPv4 adress ?
- If you're under Windows, my experience shows reboot to often be a worthwhile attempt (particularly if you just installed WinPcap and/or the vpn)
-
If you see packets being caught and sent: - Does everyone have the same StarCraft version ? (also Broodwar vs Classic)
-
Are you absolutely sure no one is firewalling UDP on any interface ?
Change Log
- Now compiles and works under Windows using WinPcap
- Includes 2 new injection methods. UDP raw and bound.
- Much cleaner code, easier to adapt to similar uses
Source code
The project’s source is hosted at http://github.com/ddlsmurf/SoV
Contributions welcome !
Technical info
In short: intercepts StarCrafts game discovery UDP broadcast packets and reinjects to a specific IP and interface to avoid broadcasts being blocked at VPNs (and NATs).
There no specific understanding of StarCraft packets, any similar UDP packets may be forwarded (using the /p port
switch).
When StarCraft is looking for a game:
- it sends a UDP broadcast packet to your whole local network saying “Hey, you got a game created ?”
Most computers ignore it, but - any computer hosting a StarCraft game, replies with a directed UDP packet saying “Hey, I got a game” and so on.
That broadcast packet is not forwarded by mosts VPNs.
SoV uses pcap to snoop in on the network, and looks for StarCraft packets.
When it finds one, it makes a copy, changes the destination to go specifically to the game host.
Just because its not a broadcast packet, like all other StarCraft packets, it gets caried by VPNs and the like just fine.
Here is a quick summary of how the injection methods sum up and work. Understanding of low level UDP packet headers is helpful.
OSI | UDP Packet Layer | Injection method | Trigger flag | Windows | Mac OS X |
---|---|---|---|---|---|
2 |
Ethernet (eg: MAC addresses) |
injection
(Windows) |
/i interface |
Requires injection interface, correct MAC addresses, uses failable logic to find IP. |
Requires injection interface, uses failable logic to find IP. |
3 |
IP (eg: IPv4 addresses) |
injection
(Mac OS X) |
|||
4 |
UDP (eg: port numbers) |
RAW UDP socket(SOCK_RAW) |
default |
Works fine on XP. Untested |
Seems to work fine |
Data |
Bound UDP socket(SOCK_DGRAM) bind() |
/bind |
Works fine on XP. Fails on Windows 7 on socket bind (already in use). |
Seems to work fine |
Credits
-
Thanks to Tim Carstens for his sniffex.c.
-
B. Borde, MamieNova, lemarsu for their patience in testing this.
-
Wireshark — by far the finest network diagnostic tool
-
Portions in SoV_Utils.* under the following notices:
- Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
- Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
Known Issues
- Windows 7 does not allow UDP socket reuse with StarCraft, preventing bound mode
- libpcap adds a couple of unexplained bytes to captures on my MacBooks airport adapter, issuing the following benign warning from SoV's packet parsing routine:
Warning: Inconsistent packet size (22 instead of 20)
Licence and Copyright
'twas written by Eric Doughty-Papassideris
Licence: IDC v2.0 ("I Dont Care")
Disclaimer
You're getting this for free, and it comes with no garantees whatsoever. It comes as-is. I don't want to know about what happened (or not) because of this code. You are getting it "as-is", and it "is not my problem".
I am in no way affiliated with Blizzard Entertainment nor StarCraft. They are, Im quite sure, registered trademarks (and a grrrrreat game ^^). Same goes for Mac OS X, libpcap, WinPcap and Windows. (grrreat games — all of 'em)