2022-04-20 02:46:21 +00:00
|
|
|
@echo off
|
|
|
|
|
2022-04-21 10:40:54 +00:00
|
|
|
:: Ensure admin
|
|
|
|
>nul 2>&1 reg query "HKU\S-1-5-19" || (
|
|
|
|
set params = %*:"="""%
|
|
|
|
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %1 "%2" ""%cd%"" ", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
|
|
|
|
)
|
|
|
|
|
2022-04-20 02:46:21 +00:00
|
|
|
echo Starting Proxy Server
|
|
|
|
|
2022-04-21 10:44:31 +00:00
|
|
|
set ip=%1
|
|
|
|
set gamePath=%2
|
|
|
|
set gamePath=%gamePath:"=%
|
|
|
|
set ORIGIN=%3
|
|
|
|
set ORIGIN=%ORIGIN:"=%
|
2022-04-20 02:46:21 +00:00
|
|
|
|
|
|
|
set PROXY=true
|
|
|
|
@rem Store original proxy settings
|
|
|
|
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2^>nul') do set "ORIG_PROXY_ENABLE=%%b"
|
|
|
|
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2^>nul') do set "ORIG_PROXY_SERVER=%%b"
|
|
|
|
|
|
|
|
:: Set proxy settings in Windows
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f >nul 2>nul
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8080" /f >nul 2>nul
|
|
|
|
|
2022-04-20 02:53:30 +00:00
|
|
|
:: Start proxy server
|
2022-04-21 10:40:54 +00:00
|
|
|
start "Proxy Server" ./ext/mitmdump.exe -s "%ORIGIN%/proxy/proxy.py" --ssl-insecure --set ip=%ip%
|
2022-04-20 02:46:21 +00:00
|
|
|
|
2022-04-20 04:55:25 +00:00
|
|
|
echo Opening %gamePath%
|
2022-04-20 02:46:21 +00:00
|
|
|
|
2022-04-21 03:22:10 +00:00
|
|
|
:: Allow the proxy server to create the certificates
|
|
|
|
ping 127.0.0.1 -n 5 > nul
|
|
|
|
|
2022-04-21 10:40:54 +00:00
|
|
|
For %%A in ("%gamePath%") do (
|
|
|
|
Set GAME_EXE=%%~nxA
|
|
|
|
)
|
|
|
|
|
|
|
|
:: Start killswitch
|
|
|
|
start /b %ORIGIN%\scripts\killswitch.cmd "%GAME_EXE%" %ip%"
|
|
|
|
|
2022-04-20 02:53:30 +00:00
|
|
|
:: Launch game
|
2022-04-20 04:55:25 +00:00
|
|
|
"%gamePath%"
|
2022-04-20 02:46:21 +00:00
|
|
|
|
2022-04-20 02:53:30 +00:00
|
|
|
:: On exit clean proxy stuff
|
2022-04-20 02:46:21 +00:00
|
|
|
:EXIT
|
|
|
|
if "%PROXY%" == "" (
|
|
|
|
echo Proxy not started, no need to clean up.
|
|
|
|
) else (
|
2022-04-20 02:53:30 +00:00
|
|
|
:: Clean proxy settings
|
2022-04-20 02:46:21 +00:00
|
|
|
echo Cleaning up proxy settings
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
|
2022-04-20 02:53:30 +00:00
|
|
|
|
|
|
|
:: Kill proxy server
|
|
|
|
taskkill /f /im mitmdump.exe
|
2022-04-21 10:40:54 +00:00
|
|
|
|
|
|
|
exit /b
|
2022-04-20 02:46:21 +00:00
|
|
|
)
|