-
Notifications
You must be signed in to change notification settings - Fork 5
/
start.bat
68 lines (58 loc) · 2.99 KB
/
start.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
setlocal
:: Get the directory path of the batch file
set "BASEPATH=%~dp0"
:: Save the path to the scripts directory
set "MITMPROXYSCRIPTFOLDER=%BASEPATH%scripts"
:: Set the path to the mitmproxy directory
set "MITMPROXYFOLDER=%BASEPATH%.mitmproxy"
set "CANRUN=true"
::Find node install in path with npm
set FOUND_NODE=
for %%e in (%PATHEXT%) do (
for %%X in (npm%%e) do (
if not defined FOUND_NODE (
set FOUND_NODE=%%~$PATH:X
)
)
)
if not defined FOUND_NODE (
echo "Node is missing! Opening the download page for you to install it...."
explorer "https://nodejs.org/en/download/prebuilt-installer/current"
set "CANRUN="
)
::Find mitmproxy with several methods
set "MITMPROXYCOMMAND="
if exist "%MITMPROXYFOLDER%\mitmweb.exe" (
set "MITMPROXYCOMMAND=cd /d "%MITMPROXYFOLDER%" && .\mitmweb.exe --mode wireguard --set connection_strategy=lazy --allow-hosts gc-openapi-zinny3.kakaogames.com --allow-hosts gc-infodesk-zinny3.kakaogames.com --allow-hosts na.wdfp.kakaogames.com --allow-hosts patch.wdfp.kakaogames.com -s ..\scripts\mitm-redirect-traffic.py"
) else (
if exist "C:\Program Files\mitmproxy\bin\mitmweb.exe" (
set "MITMPROXYCOMMAND=cd /d "%MITMPROXYSCRIPTFOLDER%" && echo Using existing mitmproxy install... && "C:\Program Files\mitmproxy\bin\mitmweb.exe" --mode wireguard --set connection_strategy=lazy --allow-hosts gc-openapi-zinny3.kakaogames.com --allow-hosts gc-infodesk-zinny3.kakaogames.com --allow-hosts na.wdfp.kakaogames.com --allow-hosts patch.wdfp.kakaogames.com -s mitm-redirect-traffic.py"
) else (
set FOUND_MITMPROXY=
for %%e in (%PATHEXT%) do (
for %%X in (mitmweb%%e) do (
if not defined FOUND_MITMPROXY (
set FOUND_MITMPROXY=%%~$PATH:X
)
)
)
if defined FOUND_MITMPROXY (
set "MITMPROXYCOMMAND=cd /d "%MITMPROXYSCRIPTFOLDER%" && echo Using existing mitmproxy install in path... && mitmweb --mode wireguard --set connection_strategy=lazy --allow-hosts gc-openapi-zinny3.kakaogames.com --allow-hosts gc-infodesk-zinny3.kakaogames.com --allow-hosts na.wdfp.kakaogames.com --allow-hosts patch.wdfp.kakaogames.com -s mitm-redirect-traffic.py"
) else (
echo "mitmproxy is not installed in the '.mitmproxy' folder. Opening download page at https://mitmproxy.org/downloads..."
explorer "https://mitmproxy.org/downloads"
echo "Please add mitmweb.exe to the .mitmproxy folder or install it via the installer. If you have Python installed, you may try 'pip install mitmproxy'"
set "CANRUN="
)
)
)
if not "%CANRUN%" == "true" (
echo Couldn't find stuff needed to run Starpoint! Please check errors above and use the web pages opened to download missing utilities. After you are done, close this window and try again.
PAUSE
exit \B
)
:: Start Node.js
start cmd.exe /k "cd /d "%BASEPATH%" && npm install && npx tsc && npm run dev"
:: Start MITMproxy
start cmd.exe /k "%MITMPROXYCOMMAND%"