0

according to this post Bind application to a specific network interface

2nd the post I tested it and it works. I set up exactly as he instructed on my pc and a virtual machine and laucnhed a multiplayer offline game and it is able to see the lan-hosted game.

this is the BindIp.cmd code

setlocal

:: IP to bind to. This env.var is used by BindIp.dll
set FORCEDIP=172.26.192.1

:: Common variables
set RegIFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%~nx1
set Injector=%~dp0injectory.x86.exe
set BindIpDll=%~dp0BindIp.dll

:: Extract target's parameters, if any
set AllParams=%*
set FirstParam=%1
call set TargetParams=%%AllParams:*%FirstParam% =%%

:: Delete debugger for the target exe in registry,
:: or we'll end in an endless loop of the batch files
reg delete "%RegIFEO%%" /v Debugger /f

:: Start target exe and inject BindIp.dll
if not [%2] == [] (
    :: If there were parameters for target exe, pass them on
    "%Injector%" --launch %1 --inject "%BindIpDll%" --args "%TargetParams%"
) else (
    :: No parameters were specified
    "%Injector%" --launch %1 --inject "%BindIpDll%"
)

:: Restore this script as debugger for the target exe in registry
reg add "%RegIFEO%" /v Debugger /t REG_SZ /d "%~dpnx0" /f

:: Debug, uncomment if needed
rem pause

endlocal

now can i use multipul ip like this in this cmd

set FORCEDIP=172.26.192.1 
set FORCEDIP= external ip
set FORCEDIP= main pc ip
set FORCEDIP= external ip

ip1
ip2
ip3
ip4

the ip list can be small or big but can i use it like this?

a lee
  • 1
  • 1

1 Answers1

0

You cannot. Multiple sockets are required to bind to multiple addresses. This requires extensive changes to software.

ForceBindIP does not introduce new sockets but only changes how existing sockets work.

Daniel B
  • 60,360
  • 9
  • 122
  • 163
  • well can i use BindIp.cmd BindIp1.cmd BindIp2.cmd and so on for each ip and update the registry also – a lee Jul 27 '22 at 05:30
  • Sure you can create multiple scripts, this will however launch the actual software multiple times. This is most likely not what you want. – Daniel B Jul 27 '22 at 05:32
  • daniel this method of using single ip works how ever in most cases it may end up using wrong ip when my ip runs on different machine. i want to rather bind all lan ips to one exe file what can i do now please help – a lee Jul 27 '22 at 05:58
  • This won’t work either because you cannot (generally) bind to addresses a computer doesn’t have assigned. – Daniel B Jul 27 '22 at 07:08
  • any ways you can think of then please. i need this – a lee Jul 27 '22 at 07:11