## ForceBindIP

Bind any Windows application to a specific interface or IP address

ForceBindIP is a freeware Windows application that will inject itself into another application and alter how certain Windows socket calls are made, allowing you to force the other application to use a specific network interface / IP address. This is useful if you are in an environment with multiple interfaces and your application has no option to bind to a specific interface.

ForceBindIP works in two stages - the loader, ForceBindIP.exe will load the target application in a suspended state. It will then inject a DLL (BindIP.dll) which loads WS2_32.DLL into memory and intercepts the bind(), connect(), sendto(), WSAConnect() and WSASendTo() functions, redirecting them to code in the DLL which verifies which interface they will be bound to and if not the one specified, (re)binds the socket. Once the function intercepts are complete, the target application is resumed. Note that some applications with anti-debugger / injection techniques may not work correctly when an injected DLL is present; for the vast majority of applications though this technique should work fine.

As of version 1.2, all known functions in WS2_32.DLL that either explicitly or implicitly bind to an interface are intercepted. Please note however that certain programs may still end up using the default interface if they implement connections that do not use the standard winsock functions. ForceBindIP will not prevent information leaks that may occur when using applications over a VPN. For example, all host name lookups (DNS requests) will be resolved through the default gateway as these requests originate from the Microsoft DNS Client, not the program.

### Usage

ForceBindIP has no user interface, it runs directly from a cmd prompt or a shortcut. To run 'app.exe' and force it to bind to 192.0.2.100, you would run ForceBindIP as "C:\Program Files (x86)\ForceBindIP\ForceBindIP.exe" 192.0.2.100 "c:\full\path\to\app.exe". Command line options for the target program may also appear after the path if needed.

Many applications expect to be started from their own folder. If you create a shortcut to ForceBindIP, the target program will start in ForceBindIP's folder instead. To fix this, edit the properties of the shortcut and set the "Start in" folder to the folder containing the program .exe you're trying to bind.

ForceBindIP can also take the GUID of an interface if for example the IP address is dynamic. To find out the GUID of your interface, run regedit and browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. Find the interface which has the dynamic address and then copy the key name. You can then run ForceBindIP as ForceBindIP {4FA65F75-7A5F-4BCA-A3A2-59824B2F5CA0} c:\path\to\app.exe

Version 1.2 and higher provides an optional -i parameter. If the target application crashes on startup or exhibits other unexpected behaviour, try using -i, eg: ForceBindIP -i 192.0.2.100 "c:\full\path\to\app.exe". This will cause the ForceBindIP loader to wait until the application has entered its message loop before injecting the interception DLL. Any network activity the application makes prior to the DLL being loaded will not have been bound to the chosen interface however.

As of version 1.3, a 64 bit build is also available - use ForceBindIP64 with 64 bit applications. Do note that even if your OS is 64 bit, many applications are still 32 bit. If you aren't sure, run your program normally and check the Task Manager details tab - 32 bit applications are marked with "* 32" next to their name.

Remember to either change to the working directory (cmd prompt) or set the "Start in" option of any shortcuts you make (see above). Missing quotes and wrong "Start in" folders are the most common reasons for ForceBindIP failing to work.

Some real examples showing proper command line quoting:

"C:\Program Files (x86)\ForceBindIP\ForceBindIP.exe" 192.0.2.100 "C:\Users\Richard\AppData\Local\Discord\app-0.0.298\Discord.exe"

"C:\Program Files (x86)\ForceBindIP\ForceBindIP64.exe" 192.0.2.100 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

Chrome requires additional configuration to run under ForceBindIP. This is because Chrome 72 or later blocks 3rd party programs from injecting DLLs. To allow ForceBindIP to work, install this enterprise policy registry file to re-enable DLL injection, then open Chrome and go to chrome://flags/#network-service-in-process and enable the setting (Chrome 76+) or chrome://flags#network-service and disable the setting (Chrome 75-).

#### Firefox Compatibility

Firefox requires the about:config?filter=browser.launcherProcess.enabled preference set to false, otherwise ForceBindIP attaches to the launcher and not the actual program.

ForceBindIP will work on 32 and 64 bit Windows XP / Vista / 7 / 8 / 10. The Visual Studio 2015 Runtimes (x86 and x64) are required for ForceBindIP to function (the installer will let you know if they're missing).

ForceBindIP-1.32-Setup.exe (101 KiB). Setup with uninstaller.

ForceBindIP-1.32.zip (42 KiB). Zip file for manual installation. The ForceBindIP EXE and and BindIP DLL files must be placed in the same folder.

### Donate

If you find ForceBindIP useful, please support my work by making a PayPal donation or using Bitcoin (1J6K7yYNC697aqNA9nM52CkwuFMDETQTYh) / Bitcoin Cash (18Hxu4ciWgiMVvyMMYpJMMF7mhqpVDxKGB). Thanks!

### Version History

• v1.32 (2017-12-01)
Updated usage instructions and improved error messages when failing to launch the target process. No functional changes.

• v1.31 (2016-08-30)
Fixed binding to the wrong port when overriding listening sockets. The problem had appeared due to code changes needed for 64 bit support. Thanks to Marvin Wagner for the report.

• v1.3 (2015-12-29)