-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.bat
204 lines (181 loc) · 16.2 KB
/
installer.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
:: Taken from: https://stackoverflow.com/a/12264592
::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
color 80
ECHO =============================
ECHO Running Admin shell
ECHO =============================
ECHO.
:init
setlocal DisableDelayedExpansion
set cmdInvoke=1
set winSysFolder=System32
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation.
ECHO **************************************
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
if '%cmdInvoke%'=='1' goto InvokeCmd
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
goto ExecElevation
:InvokeCmd
ECHO args = "/c """ + "!batchPath!" + """ " + args >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "%SystemRoot%\%winSysFolder%\cmd.exe", args, "", "runas", 1 >> "%vbsGetPrivileges%"
:ExecElevation
"%SystemRoot%\%winSysFolder%\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
REM github/mirbyte
REM v1.2
:: UTF8
chcp 65001 >nul
title VirusTotal Context Menu Installer v1.2
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
cls
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████████▒▓▒▒▒▒▒▒▒▓▒▓████████████████████████████████████████████████████
echo ████████████████████████████████████████████████████▓▒░░░░░░░░░░░░░░░▓████▓▓▒▒░░▒███████████████████████████████████████
echo █████████████████████████████████████████████▓▓▓▒▒▒▒▒▒▒▒▒▒▒░▒▒▒▒░░░░░░░▒░ ░░░ ░████████████████████████████████████████
echo ██████████████████████████████████████▒░ ░ ░▒▒▒▒▒░░▓▓▓▓▓▓▓▓██░ ░▒░░░░░░░░▓████████████████████████████████████████
echo ███████████████████████████████████████▓░░░░░░░░░▒▒░░░▓▓▓▒▒▒▒▒▒▓▓▓░ ░▒▒░ ░▓█████████████████████████████████████████
echo █████████████████████████████████████████▒░░░░░▒▒▒░░░▒▒░░░ ░░░▒▒░ ░░▒░░░▒███████████████████████████████████████████
echo ███████████████████████████████████████████▓▒▒▒▓▒░░░▒░░░░ ░░░░░▒▒░ ░░░░░▒███████████████████████████████████████████
echo █████████████████████████████████████████████▓▒▒░░░▒░░░░░░░░░░░▒░░░▒░░░░░░░░░▓██████████████████████████████████████████
echo █████████████████████████████████████████████▒▒▒░░░░░░░▒░░░░░░░░░░░░░ ░ ░░░░░▓██████████████████████████████████████████
echo ████████████████████████████████████████████▒▒▒░░░▒░░░░▒░░░░░░░░░▒░░░░░░░░░░░▒██████████████████████████████████████████
echo ███████████████████████████████████████████▓▒▒▒░░▒░░░░▒░░░░░▒░░░░░░░░░░░ ░░░░░██████████████████████████████████████████
echo ███████████████████████████████████████████▒▒▒░░░▒▒▒▒▒░▒▒░░▒▒░░░░░▒▒▒░░░░░▒▒░░▓█████████████████████████████████████████
echo ██████████████████████████████████████████▒▒▒▒▒░░▒▒▒▓▓▓▓▒▒▒▒▒░░▒▓▓▓▒▒▒░░░░▒▒░░▒█████████████████████████████████████████
echo ██████████github/mirbyte███████████████████▓▒▒░░▒▒▒░▒██▓▒░░░░░░░▒██▒░░░░░▒▒░░░▓█████████████████████████████████████████
echo ██████████████████████████████████████████▓▓▒▒▒░░▒░▒▒░▒▒░░░░░░░░░▒▒░▒░░░░▒▒▒░░░▒████████████████████████████████████████
echo ████████████████████████████████████████████▓▒▓▒▒▒▒▒▓░░░░░░░░░░░░░░▒▒░░░░▒▒▒▒░▒░▓███████████████████████████████████████
echo ████████████████████████████████████████████▓░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░▒░░░▒▒░▒░▒░▒███████████████████████████████████████
echo █████████████████████████████████████████████▒▒▒▒▓▒▒▒▒▒░░░░░░░░░░░░▒▒░░░░▒▒░░▒▒▒▒███████████████████████████████████████
echo █████████████████████████████████████████████░▒▒▒▓▓▒▒░▒▒▒▒░░░░░░░▒▒▒░░░░░▒▒▒▒▒▒▒░███████████████████████████████████████
echo █████████████████████████████████████████████▓▒▓▓▓▒░░░▒▒▒▓▓▓▓▓▒▒▓▒▓▓░░░░░▒▒▒▒▒▒▒▒▓██████████████████████████████████████
echo ███████████████████████████████████████████▓▒▓████▓▓▓▓▒▒░▒▓▓▓█▓▓▓▓▓▒░░▒░▒▒▓▓▓▓▓▒▒▒██████████████████████████████████████
echo ██████████████████████████████████████████░░░▓███▓▓▓▓▓▓▓░░▓▓▓█▓▓▓▓▓░▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒█████████████████████████████████████
echo █████████████████████████████████████████▓░░▓███▓▓▓▓▓▓█▓▒░▒▓███▓▓▓░░▒▒▓▓▒▓▓▓▓▓▓▓▓▒▒▓████████████████████████████████████
echo ██████████████████████████████████████████▓░▓▓██▓▓█████▓▒▒▒▒▓▓▒▓▓▓▓░▒▓▓▒▓▓▓▓▓▓▓▓▓▒░▒████████████████████████████████████
:: reset characters back
chcp 437 >nul
color 80
timeout /t 3 /nobreak >nul
cls
echo Removing previous version if exists...
reg delete "HKEY_CLASSES_ROOT\*\shell\Scan with VirusTotal" /f >nul 2>&1
rmdir /s /q "%ProgramFiles%\VirusTotalScanner" >nul 2>&1
:: animation uwu
echo +
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo x
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo +
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo x
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo +
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo x
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo +
powershell -Command "Start-Sleep -Milliseconds 200"
cls
echo Removing previous version if exists...
echo x
powershell -Command "Start-Sleep -Milliseconds 200"
cls
:: animation end
echo Enter your VirusTotal API key:
set /p api_key=""
cls
if "%api_key%"=="" (
echo Error: API key input was empty.
echo.
echo.
echo Press any key to exit...
pause >nul
exit /b
)
:: FIX SPACES
for /f "delims=" %%a in ("%api_key%") do set api_key=%%a
echo|set /p="%api_key%" > "files\api_key.txt"
cls
echo Please wait... This might take a minute or two.
type nul > files\api_k.txt
REM obfuscation 😁
for /f "delims=" %%A in (files\api_key.txt) do (
set "X=%%A"
set "Y="
for /l %%B in (0,1,255) do (
set "Z=!X:~%%B,1!"
if defined Z (
for /f "tokens=1 delims==" %%C in ('powershell -command "[int][char]'!Z!'"') do set "A=%%C"
set /a "B=A+1"
for /f "tokens=1 delims==" %%D in ('powershell -command "[char]!B!"') do set "F=%%D"
set "Y=!Y!!F!"
)
)
echo !Y! >> files\api_k.txt
)
cls
cls
echo Do you want to install the program to %ProgramFiles%\VirusTotalScanner?
set /p confirm="Press Y for yes, N for no: "
cls
if /i "%confirm%"=="Y" (
if not exist "%ProgramFiles%\VirusTotalScanner" mkdir "%ProgramFiles%\VirusTotalScanner"
copy /Y "files\vt_scanner.exe" "%ProgramFiles%\VirusTotalScanner\vt_scanner.exe"
copy /Y "files\api_k.txt" "%ProgramFiles%\VirusTotalScanner\api_k.txt"
echo github.com/mirbyte/VirusTotal-Context-Menu > "%ProgramFiles%\VirusTotalScanner\note.txt"
reg add "HKEY_CLASSES_ROOT\*\shell\Scan with VirusTotal" /ve /t REG_SZ /d "Scan with VirusTotal" /f
reg add "HKEY_CLASSES_ROOT\*\shell\Scan with VirusTotal\command" /t REG_SZ /d "\"%ProgramFiles%\\VirusTotalScanner\\vt_scanner.exe\" \"%%1\"" /f
echo.
echo Installation completed, please check above for errors.
echo Press any key to exit...
pause >nul
) else (
echo.
echo Installation cancelled. Edit the script for custom install location.
echo Press any key to exit...
pause >nul
)