SoV - StarCraft Over VPN - Version 2
Thank you for your interest and time in testing SoV2
Please use the comments at the bottom of this page to provide feedback on how it worked or didnt on your system, and what your environment was, what arguments you used, and so on.
There are currently three methods of injection, I am trying to ensure the one I set as default is the one that works everywhere. We'll be trying them in order of ease. In my experience, most people find the first one (raw udp) just fine.
Sections
- Downloads
- Windows Instructions
- Mac OS X Instructions
- Command line arguments
- Troubleshooting
- Technical info
- Change Log
- Source code
- Credits
- Known Issues
- Comments
Disclaimer
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.
You're getting this for free, and it comes with no garantees whatsoever. It comes as-is.
Downloads
- Download the Windows binary (intel only)
- Download the Mac OS X binary (intel only)
Windows
(for Mac OS X click here)1) Installation - Finding your interfaces
- Download WinPcap, and install it
- Download SoV 2 for Windows, and unzip it somewhere
- Open a command prompt as administrator and cd into the folder with SoV.exe
- Type SoV /L
It should show something like: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
- Without bi-directional connectivity, no point in continuing !
3) Start the games
- Start the game, this might be a good time to check the version of StarCraft (here — have a link to patch 1.16.1)
- Please note that you must both use UDP multiplayer
- Tell the game host to create the game, and wait at the game lobby.
- 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 ⌘ M on Mac OS X) to return to the command line
4.a) Running in UDP RAW mode
- Run SoV lan_dev creator_ip
It should show something like: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:
- Run SoV /bind lan_dev creator_ip
It should show something like: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 run ping creator_ip.
SoV should show something like: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.
- Run SoV lan_dev /i vpn_dev creator_ip /esrc mac_vpn /edst mac_hop
It should show something like:
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 sur you have libpcap installed. If not, sudo port install libpcap (youll need MacPorts installed first)
- Download SoV 2 for Mac OS X, and unzip it somewhere, then flag it executable:
~ $ mkdir sov && cd sov ~/sov $ curl -O http://s-softs.com/downloads/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 SoV -L
It should show something like:~/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 rest of the instructions are the same as the windows version.
- 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 !
Mac OS X - 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
It should show something like:
~/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
Command line arguments
- All switches are case insensitive.
- They may be used with - or /.
- 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. 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 | 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. |
Further 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 version of StarCraft ? (Broodwar or Classic, see the version in the bottom right of the first menu of the game)
- 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
Source code is available on GitHub 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, and any StarCraft with a running 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.
- libPcap team
- WinPcap team
- B. Borde, MamieNova, lemarsu for their patience in testing this.
- Wireshark — by far the finest network diagnostic tool
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 warning from SoV's packet parsing routine:
Warning: Inconsistent packet size (22 instead of 20)