-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
363 lines (335 loc) · 35.8 KB
/
install.ps1
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# This is a PowerShell script to install tools on Windows
# powershell -ExecutionPolicy Bypass -File \\tsclient\share\wined\install.ps1
# Constants
$client_ip = "192.168.0.17"
if (Test-Path "\\tsclient\share\wininstallers\") {
$install_share = "\\tsclient\share\wininstallers"
} else {
$install_share = "\\$($client_ip)\share\wininstallers"
}
$user_desktop = "C:\Users\$($env:USERNAME)\Desktop"
$install_dir = "$($user_desktop)\install"
$sysinternals_dir = "$user_desktop\systinternals"
$shortcut_path = "C:\Users\$($env:USERNAME)\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\WinDbg.lnk"
$is_64 = (Get-WmiObject Win32_OperatingSystem).OSArchitecture -eq "64-bit"
# Program Files
$program_files = "C:\Program Files"
if ($is_64) {
$program_files_x86 = "C:\Program Files (x86)"
}
else {
$program_files_x86 = $program_files
}
# Check admin
$elevated_flag = [Security.Principal.WindowsIdentity]::GetCurrent().groups -match 'S-1-5-32-544'
if (-not $elevated_flag) {
Write-Output "Script is not running with administrative privileges. Please run the script as an administrator."
Exit 1
}
# Network Connection Profile
Write-Output "[*] Setting network connection profile to private."
Set-NetConnectionProfile -InterfaceAlias Ethernet0 -NetworkCategory Private
# Checking internet connectivity
Write-Output "[*] Checking internet connectivity.."
if (Test-Connection -ComputerName google.com -Count 1 -Quiet) {
Write-Host "[+] Internet successful. No proxy settings needed."
} else {
Write-Host "[*] Internet unsuccessful. Setting manual proxy settings."
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyEnable -Value 1
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyServer -Value "$($client_ip):3128"
}
# Check Windows Modules Installer (TrustedInstaller) service needs to be running to install VC runtime.
$trustedinstallerService = "TrustedInstaller"
$service = Get-Service -Name $trustedinstallerService -ErrorAction SilentlyContinue
if ($null -ne $service -and $service.StartType -eq "Disabled") {
try {
Write-Output "[*] Setting $trustedinstallerService startup type to Manual."
Set-Service -Name $trustedinstallerService -StartupType Manual -ErrorAction Stop
}
catch {
Write-Output "[-] Failed to set $trustedinstallerService startup type to Manual."
Exit 1
}
}
Start-Service -Name $trustedinstallerService -ErrorAction Stop
# Wait for TrustedInstaller to start
try {
Write-Output "[*] Waiting for $trustedinstallerService to start..."
$start_time = Get-Date
while ((Get-Service -Name $trustedinstallerService).Status -ne "Running") {
if ((Get-Date) - $start_time -gt ([TimeSpan]::FromSeconds(60))) {
throw "[-] Timeout waiting for $trustedinstallerService to start."
}
Start-Sleep -Seconds 1
}
Write-Output "[*] $trustedinstallerService is running. Proceeding with installation."
}
catch {
Write-Output $_.Exception.Message
Write-Output "[-] Unable to start $trustedinstallerService service. Installation aborted."
}
# Disable UAC
Write-Output "[*] Disabling UAC"
Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 0
# Get installs
if ($is_64) {
$install_keys = @(
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
}
else {
$install_keys = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
}
$current_installs = foreach ($key in $install_keys) {
Get-Item $key | Get-ItemProperty
}
# Output messages for the user
if (-not (Test-Path $install_dir)) {
Write-Output "[*] Creating installation directory: $install_dir"
mkdir $install_dir > $null
if (-not (Test-Path $install_dir)) {
Write-Error "Failed to create installation directory: $install_dir"
Exit 1
}
}
# Install latest Windows SDK
if ($null -eq ($current_installs | Where-Object { $_.DisplayName -eq "X86 Debuggers And Tools" -and $_.DisplayVersion -eq "10.1.22621.1778" })) {
Write-Output "[*] Installing new x86 SDK Debugger and Tools - v10.1.22621.1778"
Copy-Item "$install_share\winsdk\X86 Debuggers And Tools-x86_en-us.msi" "$install_dir"
Start-Process msiexec.exe -ArgumentList "/i `"X86 Debuggers And Tools-x86_en-us.msi`" /qn" -Wait -WorkingDirectory "$install_dir"
}
if ($is_64) {
if ($null -eq ($current_installs | Where-Object { $_.DisplayName -eq "x64 Debuggers And Tools" -and $_.DisplayVersion -eq "10.1.22621.1778" })) {
Write-Output "[*] Installing new x64 SDK Debugger and Tools - v10.1.22621.1778"
Copy-Item "$install_share\winsdk\X64 Debuggers And Tools-x64_en-us.msi" "$install_dir"
Start-Process msiexec.exe -ArgumentList "/i `"X64 Debuggers And Tools-x64_en-us.msi`" /qn" -Wait -WorkingDirectory "$install_dir"
}
}
# Install windbg theme
Write-Output "[*] Installing custom windbg theme"
New-Item -Path "HKCU:\Software\Microsoft\Windbg\Workspaces" -Force > $null
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windbg\Workspaces" -Name "Default" -Value ([byte[]](0x57,0x44,0x57,0x53,0x01,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x68,0x00,0x5C,0x00,0xF3,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x01,0x31,0x43,0x00,0x6F,0x00,0x6E,0x00,0x73,0x00,0x6F,0x00,0x6C,0x00,0x61,0x00,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x6F,0x6D,0x7E,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x80,0x31,0x3A,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x6F,0x6D,0x7E,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xE6,0x1E,0x3C,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x52,0x54,0x58,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0x69,0x4B,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x75,0xA6,0x87,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x75,0xA6,0x87,0x00,0x00,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x75,0x87,0xA6,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xAF,0xC4,0xDB,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x33,0x99,0xFF,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x52,0x54,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x02,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x80,0x31,0x3A,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x09,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x0A,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x0B,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x10,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x11,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x12,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x13,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x38,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x39,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x3A,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x21,0x06,0x00,0x00,0x41,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x25,0x06,0x00,0x00,0x23,0x00,0x00,0x00,0x10,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0xB8,0x00,0xAE,0x00,0x22,0x00,0x43,0x00,0x3A,0x00,0x5C,0x00,0x55,0x00,0x73,0x00,0x65,0x00,0x72,0x00,0x73,0x00,0x5C,0x00,0x62,0x00,0x75,0x00,0x72,0x00,0x6C,0x00,0x79,0x00,0x5C,0x00,0x44,0x00,0x6F,0x00,0x63,0x00,0x75,0x00,0x6D,0x00,0x65,0x00,0x6E,0x00,0x74,0x00,0x73,0x00,0x5C,0x00,0x56,0x00,0x69,0x00,0x73,0x00,0x75,0x00,0x61,0x00,0x6C,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x75,0x00,0x64,0x00,0x69,0x00,0x6F,0x00,0x20,0x00,0x32,0x00,0x30,0x00,0x31,0x00,0x30,0x00,0x5C,0x00,0x50,0x00,0x72,0x00,0x6F,0x00,0x6A,0x00,0x65,0x00,0x63,0x00,0x74,0x00,0x73,0x00,0x5C,0x00,0x50,0x00,0x72,0x00,0x6F,0x00,0x63,0x00,0x65,0x00,0x73,0x00,0x73,0x00,0x49,0x00,0x6E,0x00,0x6A,0x00,0x65,0x00,0x63,0x00,0x74,0x00,0x69,0x00,0x6F,0x00,0x6E,0x00,0x5C,0x00,0x62,0x00,0x69,0x00,0x6E,0x00,0x5C,0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x33,0x00,0x32,0x00,0x5C,0x00,0x44,0x00,0x65,0x00,0x62,0x00,0x75,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x20,0x00,0x16,0x00,0x63,0x00,0x3A,0x00,0x5C,0x00,0x73,0x00,0x79,0x00,0x6D,0x00,0x62,0x00,0x6F,0x00,0x6C,0x00,0x73,0x00,0x00,0x00,0x6F,0x00,0x20,0x00,0x00,0x00,0xC0,0x00,0xB2,0x00,0x4C,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x08,0x00,0x07,0x00,0x06,0x00,0x0E,0x00,0x0A,0x00,0x05,0x00,0x04,0x00,0x0B,0x00,0x52,0x00,0x51,0x00,0x50,0x00,0x4F,0x00,0x4E,0x00,0x4D,0x00,0x4B,0x00,0x4A,0x00,0x4C,0x00,0x02,0x00,0x0C,0x00,0x0F,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x1E,0x00,0x30,0x00,0x31,0x00,0x32,0x00,0x33,0x00,0x34,0x00,0x35,0x00,0x36,0x00,0x37,0x00,0x10,0x00,0x11,0x00,0x12,0x00,0x13,0x00,0x14,0x00,0x15,0x00,0x16,0x00,0x17,0x00,0x18,0x00,0x19,0x00,0x1A,0x00,0x1B,0x00,0x1C,0x00,0x1D,0x00,0x1F,0x00,0x20,0x00,0x21,0x00,0x22,0x00,0x23,0x00,0x24,0x00,0x25,0x00,0x26,0x00,0x27,0x00,0x28,0x00,0x29,0x00,0x2A,0x00,0x2B,0x00,0x2C,0x00,0x2D,0x00,0x2E,0x00,0x2F,0x00,0x38,0x00,0x39,0x00,0x3A,0x00,0x3B,0x00,0x3C,0x00,0x3D,0x00,0x3E,0x00,0x3F,0x00,0x40,0x00,0x41,0x00,0x42,0x00,0x43,0x00,0x44,0x00,0x45,0x00,0x46,0x00,0x47,0x00,0x48,0x00,0x49,0x00,0x53,0x00,0x54,0x00,0x0D,0x00,0x65,0x00,0x73,0x00,0x73,0x00,0x04,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x80,0x31,0x3A,0x00,0x63,0x00,0x00,0x00,0x3D,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x72,0x00,0x73,0x00,0x0C,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x5C,0x00,0x44,0x00,0x3C,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x74,0x00,0x73,0x00,0x05,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xE6,0x1E,0x3C,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x0D,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x33,0x99,0xFF,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xCD,0xA8,0x69,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x6F,0x6D,0x7E,0x00,0x00,0x00,0x00,0x00,0x17,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0xAF,0xC4,0xDB,0x00,0x00,0x00,0x00,0x00,0x24,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x33,0x99,0xFF,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xD2,0xD2,0x3A,0x00,0x00,0x00,0x00,0x00,0x05,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x06,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x0C,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xD2,0xD2,0x3A,0x00,0x00,0x00,0x00,0x00,0x0D,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x0E,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x3B,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x3C,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x3D,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x3E,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0xCF,0xCE,0x9A,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0x00,0x00,0x80,0x00,0x74,0x00,0x43,0x00,0x3A,0x00,0x5C,0x00,0x50,0x00,0x72,0x00,0x6F,0x00,0x67,0x00,0x72,0x00,0x61,0x00,0x6D,0x00,0x20,0x00,0x46,0x00,0x69,0x00,0x6C,0x00,0x65,0x00,0x73,0x00,0x5C,0x00,0x44,0x00,0x65,0x00,0x62,0x00,0x75,0x00,0x67,0x00,0x67,0x00,0x69,0x00,0x6E,0x00,0x67,0x00,0x20,0x00,0x54,0x00,0x6F,0x00,0x6F,0x00,0x6C,0x00,0x73,0x00,0x20,0x00,0x66,0x00,0x6F,0x00,0x72,0x00,0x20,0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x64,0x00,0x6F,0x00,0x77,0x00,0x73,0x00,0x20,0x00,0x28,0x00,0x78,0x00,0x36,0x00,0x34,0x00,0x29,0x00,0x5C,0x00,0x74,0x00,0x68,0x00,0x65,0x00,0x6D,0x00,0x65,0x00,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0xA8,0x00,0x9C,0x00,0x01,0x00,0x00,0x00,0x43,0x00,0x3A,0x00,0x5C,0x00,0x50,0x00,0x72,0x00,0x6F,0x00,0x67,0x00,0x72,0x00,0x61,0x00,0x6D,0x00,0x20,0x00,0x46,0x00,0x69,0x00,0x6C,0x00,0x65,0x00,0x73,0x00,0x5C,0x00,0x44,0x00,0x65,0x00,0x62,0x00,0x75,0x00,0x67,0x00,0x67,0x00,0x69,0x00,0x6E,0x00,0x67,0x00,0x20,0x00,0x54,0x00,0x6F,0x00,0x6F,0x00,0x6C,0x00,0x73,0x00,0x20,0x00,0x66,0x00,0x6F,0x00,0x72,0x00,0x20,0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x64,0x00,0x6F,0x00,0x77,0x00,0x73,0x00,0x20,0x00,0x28,0x00,0x78,0x00,0x36,0x00,0x34,0x00,0x29,0x00,0x5C,0x00,0x74,0x00,0x68,0x00,0x65,0x00,0x6D,0x00,0x65,0x00,0x73,0x00,0x5C,0x00,0x70,0x00,0x6C,0x00,0x61,0x00,0x63,0x00,0x65,0x00,0x68,0x00,0x6F,0x00,0x6C,0x00,0x64,0x00,0x31,0x00,0x2E,0x00,0x63,0x00,0x00,0x00,0x02,0x00,0x10,0x00,0x04,0x00,0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x6E,0x00,0x67,0x00,0x04,0x00,0x03,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x04,0x00,0x01,0x00,0x70,0x02,0x68,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0x43,0x00,0x00,0x00,0xEB,0x03,0x00,0x00,0x5F,0x01,0x00,0x00,0x05,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x4E,0x04,0x00,0x00,0x5C,0x02,0x00,0x00,0x84,0x07,0x00,0x00,0x71,0x03,0x00,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x68,0x03,0x00,0x00,0x95,0x02,0x00,0x00,0x99,0x06,0x00,0x00,0x89,0x03,0x00,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x07,0x01,0x00,0x00,0xBD,0x03,0x00,0x00,0x97,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x2D,0x03,0x00,0x00,0xD0,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x4A,0x00,0x00,0x00,0xA2,0x06,0x00,0x00,0xAB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x81,0x03,0x00,0x00,0xED,0x01,0x00,0x00,0x1D,0x05,0x00,0x00,0x53,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x6A,0x00,0x00,0x00,0xFC,0x02,0x00,0x00,0xFA,0x01,0x00,0x00,0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x8A,0x00,0x00,0x00,0x1C,0x03,0x00,0x00,0x1A,0x02,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x10,0x00,0x08,0x00,0x09,0x00,0x00,0x00,0xF8,0x0C,0x00,0x00,0x01,0x00,0x01,0x00,0x38,0x00,0x2C,0x00,0x2C,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xD4,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x10,0x04,0x00,0x00,0xCA,0x01,0x00,0x00,0x03,0x00,0x03,0x00,0x78,0x00,0x6E,0x00,0x07,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0x04,0x01,0x00,0x00,0x82,0x03,0x00,0x00,0x4C,0x00,0x00,0x00,0xA0,0x06,0x00,0x00,0xA9,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x7A,0x00,0x00,0x00,0x0C,0x03,0x00,0x00,0x0A,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x78,0x00,0x6C,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x73,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x04,0x00,0x00,0xA7,0x01,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x68,0x03,0x00,0x00,0x95,0x02,0x00,0x00,0x99,0x06,0x00,0x00,0x89,0x03,0x00,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x00,0x00,0x40,0x07,0x00,0x00,0x40,0x08,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0xCA,0x01,0x00,0x00,0x03,0x00,0x03,0x00,0x80,0x00,0x74,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x40,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA7,0x01,0x00,0x00,0x73,0x03,0x00,0x00,0x09,0x03,0x00,0x00,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x2D,0x03,0x00,0x00,0xD0,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0xEA,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x80,0x00,0x74,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x04,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x7F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0x06,0x00,0x00,0xA7,0x01,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x4E,0x04,0x00,0x00,0x5C,0x02,0x00,0x00,0x84,0x07,0x00,0x00,0x71,0x03,0x00,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x00,0x00,0x40,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x74,0x00,0x03,0x00,0x03,0x00,0x78,0x00,0x6C,0x00,0x0B,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x04,0x00,0x00,0x40,0x06,0x00,0x00,0x00,0x7F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0x06,0x00,0x00,0xA7,0x01,0x00,0x00,0x0B,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x8A,0x00,0x00,0x00,0x1C,0x03,0x00,0x00,0x1A,0x02,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x10,0x00,0x04,0x00,0x03,0x00,0x03,0x00,0x90,0x00,0x86,0x00,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x19,0x05,0x00,0x00,0xA7,0x01,0x00,0x00,0xAE,0x06,0x00,0x00,0x09,0x03,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x3A,0x00,0x00,0x00,0xCC,0x02,0x00,0x00,0xCA,0x01,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0xFF,0x0F,0x03,0x00,0x00,0x40,0x01,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x40,0x00,0x65,0x00,0x73,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x98,0x00,0x90,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x73,0x03,0x00,0x00,0xA7,0x01,0x00,0x00,0x19,0x05,0x00,0x00,0x09,0x03,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x81,0x03,0x00,0x00,0xED,0x01,0x00,0x00,0x1D,0x05,0x00,0x00,0x53,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x40,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x40,0x00,0x24,0x00,0x73,0x00,0x63,0x00,0x6F,0x00,0x70,0x00,0x65,0x00,0x69,0x00,0x70,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x80,0x00,0x78,0x00,0x05,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x03,0x00,0x00,0xA7,0x01,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x07,0x01,0x00,0x00,0xBD,0x03,0x00,0x00,0x97,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x00,0x00,0x40,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x80,0x00,0x74,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x7F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0x06,0x00,0x00,0xA7,0x01,0x00,0x00,0x0A,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x6A,0x00,0x00,0x00,0xFC,0x02,0x00,0x00,0xFA,0x01,0x00,0x00,0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x40,0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x10,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00)) > $null
if (Test-Path $shortcut_path) {
# Remove old shortcut workspace
$shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut($shortcut_path)
$shortcut.Arguments = ""
$shortcut.Save()
}
# Install old C++ runtimes
# Install VCRedist 2008 if not installed
if ($null -eq ($current_installs | Where-Object { $_.DisplayName -eq "Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161" })) {
Write-Output "[*] Updating to Microsoft Visual C++ 2008 Redistributable Package (x86) - 9.0.30729.6161"
if (-not (Test-Path "$install_dir\vcredist_x86_2008.exe")) {
Copy-Item "$install_share\vcredist_x86_2008.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x86_2008.exe" -ArgumentList "/q" -Wait -WorkingDirectory "$install_dir"
if ($is_64) {
Write-Output "[*] Updating to Microsoft Visual C++ 2008 Redistributable Package (x64) - 9.0.30729.6161"
if (-not (Test-Path "$install_dir\vcredist_x64_2008.exe")) {
Copy-Item "$install_share\vcredist_x64_2008.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x64_2008.exe" -ArgumentList "/q" -Wait -WorkingDirectory "$install_dir"
}
}
# Install VCRedist 2013 if not installed
if ($null -eq ($current_installs | Where-Object { $_.DisplayName -eq "Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.40664" })) {
Write-Output "[*] Updating to Microsoft Visual C++ 2013 Redistributable Package (x86) - 12.0.40664"
if (-not (Test-Path "$install_dir\vcredist_x86_2013.exe")) {
Copy-Item "$install_share\vcredist_x86_2013.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x86_2013.exe" -ArgumentList "/install /quiet /norestart" -Wait -WorkingDirectory "$install_dir"
if ($is_64) {
Write-Output "[*] Updating to Microsoft Visual C++ 2013 Redistributable Package (x64) - 12.0.40664"
if (-not (Test-Path "$install_dir\vcredist_x64_2013.exe")) {
Copy-Item "$install_share\vcredist_x64_2013.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x64_2013.exe" -ArgumentList "/q" -Wait -WorkingDirectory "$install_dir"
}
}
# Install VCRedist 2015-2022 if not installed
if ($null -eq ($current_installs | Where-Object { $_.DisplayName -eq "Microsoft Visual C++ 2015-2022 Redistributable (x86) - 14.38.33135" })) {
Write-Output "[*] Updating to Microsoft Visual C++ 2015-2022 Redistributable Package (x86) - 14.38.33135.0"
if (-not (Test-Path "$install_dir\vcredist_x86_2015.exe")) {
Copy-Item "$install_share\vcredist_x86_2015.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x86_2015.exe" -ArgumentList "/install /quiet /norestart" -Wait -WorkingDirectory "$install_dir"
if ($is_64) {
Write-Output "[*] Updating to Microsoft Visual C++ 2015-2022 Redistributable Package (x64) - 14.38.33135.0"
if (-not (Test-Path "$install_dir\vcredist_x64_2015.exe")) {
Copy-Item "$install_share\vcredist_x64_2015.exe" "$install_dir"
}
Start-Process -FilePath ".\vcredist_x64_2015.exe" -ArgumentList "/q" -Wait -WorkingDirectory "$install_dir"
}
}
# Copy over rp++
if (-not (Test-Path "$user_desktop\rp.exe")) {
Write-Output "[*] Bringing over rp++"
if ($is_64) {
Copy-Item "$install_share\rp_x64.exe" "$user_desktop\rp.exe"
}
else {
Copy-Item "$install_share\rp_x86.exe" "$user_desktop\rp.exe"
}
}
# Copy over sysinternals
if (-not (Test-Path "$install_dir\sysinternals.zip")) {
Write-Output "[*] Bringing over sysinternals"
Copy-Item "$install_share\sysinternals.zip" "$install_dir\sysinternals.zip"
}
if (-not (Test-Path $sysinternals_dir)) {
Write-Output "[*] Extracting sysinternals"
New-Item -ItemType Directory -Path $sysinternals_dir | Out-Null
Expand-Archive -Path "$install_dir\sysinternals.zip" -DestinationPath "$sysinternals_dir" -Force
}
# Copy over systeminformer
if (-not (Test-Path "$program_files\SystemInformer")) {
if (-not (Test-Path "$install_dir\systeminformer.exe")) {
Write-Output "[*] Bringing over systeminformer"
if ($is_64) {
Copy-Item "$install_share\systeminformer_x64.exe" "$install_dir\systeminformer.exe"
}
else {
Copy-Item "$install_share\systeminformer_x86.exe" "$install_dir\systeminformer.exe"
}
Write-Output "[*] Installing systeminformer"
Start-Process -FilePath ".\systeminformer.exe" -ArgumentList "/install /quiet /norestart" -Wait -WorkingDirectory "$install_dir"
}
}
# Copy over idafree
if ($is_64) {
if ($null -eq ($current_installs | Where-Object { $_.Publisher -eq "Hex-Rays SA" })) {
if (-not (Test-Path "$install_dir\idafree.exe")) {
Write-Output "[*] Bringing over idafree (x64)"
Copy-Item "$install_share\idafree_x64.exe" "$install_dir\idafree.exe"
}
Write-Output "[*] Installing idafree"
Start-Process -FilePath ".\idafree.exe" -Wait -WorkingDirectory "$install_dir"
}
}
# Install Python 3.11.8
if (-not (Test-Path "$program_files\Python311-32")) {
Write-Output "[*] Installing Python 3.11.8"
if (-not (Test-Path "$install_dir\python-3.11.8.exe")) {
Copy-Item "$install_share\python-3.11.8.exe" "$install_dir"
}
Start-Process python-3.11.8.exe -ArgumentList "/quiet InstallAllUsers=1" -Wait -WorkingDirectory "$install_dir"
# Register Python 3.11.8 binaries in PATH before Python3
Write-Output "[*] Adding Python 3.11.8 to the PATH"
$userPath = [System.Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User)
if ($userPath -notlike "*Python311-32*") {
[System.Environment]::SetEnvironmentVariable('Path', "$program_files\Python311-32\Scripts;$program_files\Python311-32\;" + $userPath, [System.EnvironmentVariableTarget]::User)
}
}
# Install Python 2.7
if (-not (Test-Path "C:\Python27\")) {
Write-Output "[*] Installing Python 2.7.18"
if (-not (Test-Path "$install_dir\python-2.7.18.msi")) {
Copy-Item "$install_share\python-2.7.18.msi" "$install_dir"
}
Start-Process msiexec.exe -ArgumentList "/i python-2.7.18.msi /qn" -Wait -WorkingDirectory "$install_dir"
# Register Python 2.7 binaries in PATH before Python3
Write-Output "[*] Adding Python 2.7.18 to the PATH"
$userPath = [System.Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User)
if ($userPath -notlike "*Python27*") {
[System.Environment]::SetEnvironmentVariable('Path', "C:\Python27\Scripts;C:\Python27\;" + $userPath, [System.EnvironmentVariableTarget]::User)
}
}
# Install python 2/3 extensions
Write-Output "[*] Installing keystone engine"
if (-not (Test-Path "$install_dir\keystone_engine-0.9.2-py2.py3-none-win32.whl")) {
Copy-Item "$install_share\keystone_engine-0.9.2-py2.py3-none-win32.whl" "$install_dir"
}
Start-Process "C:\Python27\python.exe" -ArgumentList "-m pip install .\keystone_engine-0.9.2-py2.py3-none-win32.whl" -Wait -WorkingDirectory "$install_dir"
Start-Process "$program_files\Python311-32\python.exe" -ArgumentList "-m pip install .\keystone_engine-0.9.2-py2.py3-none-win32.whl" -Wait -WorkingDirectory "$install_dir"
Write-Output "[*] Installing capstone engine"
if (-not (Test-Path "$install_dir\capstone-5.0.1-py3-none-win32.whl")) {
Copy-Item "$install_share\capstone-5.0.1-py3-none-win32.whl" "$install_dir"
}
Start-Process "C:\Python27\python.exe "-ArgumentList "-m pip install .\capstone-5.0.1-py3-none-win32.whl" -Wait -WorkingDirectory "$install_dir"
Start-Process "$program_files\Python311-32\python.exe" -ArgumentList "-m pip install .\capstone-5.0.1-py3-none-win32.whl" -Wait -WorkingDirectory "$install_dir"
# Back up old pykd files
if ((Test-Path "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.pyd")) {
if (-not (Test-Path "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.pyd.bak")) {
Write-Output "[*] Backing up pykd.pyd (x86)"
Move-Item "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.pyd" "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.pyd.bak"
}
}
if ((Test-Path "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.dll")) {
if (-not (Test-Path "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.dll.bak")) {
Write-Output "[*] Backing up pykd.dll (x86)"
Move-Item "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.dll" "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\pykd.dll.bak"
}
}
if ($is_64) {
if ((Test-Path "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.pyd")) {
if (-not (Test-Path "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.pyd.bak")) {
Write-Output "[*] Backing up pykd.pyd (x64)"
Move-Item "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.pyd" "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.pyd.bak"
}
}
if ((Test-Path "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.dll")) {
if (-not (Test-Path "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.dll.bak")) {
Write-Output "[*] Backing up pykd.dll (x64)"
Move-Item "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.dll" "$program_files\Windows Kits\10\Debuggers\x64\winext\pykd.dll.bak"
}
}
}
# Copy extensions files
Write-Output "[*] Bringing over python debuggers - mona, narly (x86)"
Copy-Item "$install_share\windbglib.py" "$program_files_x86\Windows Kits\10\Debuggers\x86\"
Copy-Item "$install_share\mona.py" "$program_files_x86\Windows Kits\10\Debuggers\x86\"
Copy-Item "$install_share\pykd.pyd" "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\"
Copy-Item "$install_share\narly_x86.pdb" "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\narly.pdb"
Copy-Item "$install_share\narly_x86.dll" "$program_files_x86\Windows Kits\10\Debuggers\x86\winext\narly.dll"
if ($is_64) {
Write-Output "[*] Bringing over python debuggers - mona, narly (x64)"
Copy-Item "$install_share\windbglib.py" "$program_files\Windows Kits\10\Debuggers\x64\"
Copy-Item "$install_share\mona.py" "$program_files\Windows Kits\10\Debuggers\x64\"
Copy-Item "$install_share\pykd.pyd" "$program_files\Windows Kits\10\Debuggers\x64\winext\"
Copy-Item "$install_share\narly_x64.pdb" "$program_files\Windows Kits\10\Debuggers\x64\winext\narly.pdb"
Copy-Item "$install_share\narly_x64.dll" "$program_files\Windows Kits\10\Debuggers\x64\winext\narly.dll"
}
# Register runtime debug DLLs
if (Test-Path "$program_files_x86\Common Files\Microsoft Shared\VC\msdia90.dll") {
Write-Output "[*] Registering runtime debug DLL (x86)"
Start-Process regsvr32.exe -ArgumentList "/s msdia90.dll" -Wait -WorkingDirectory "$program_files_x86\Common Files\Microsoft Shared\VC"
}
if ($is_64) {
if (Test-Path "$program_files\Common Files\Microsoft Shared\VC\msdia90.dll") {
Write-Output "[*] Registering runtime debug DLL (x64)"
Start-Process regsvr32.exe -ArgumentList "/s msdia90.dll" -Wait -WorkingDirectory "$program_files\Common Files\Microsoft Shared\VC"
}
}
# Visual studios
$installVSCode = Read-Host "Do you want to install Visual Studio Code? (Y/N)"
if ($installVSCode -eq 'Y' -or $installVSCode -eq 'y') {
# Install vscode
$vsixFiles = Get-ChildItem -Path "$install_dir" -Filter "*.vsix"
if ($vsixFiles.Count -eq 0) {
if ($is_64) {
Write-Output "[*] Bringing over vscode (x64)"
Copy-Item "$install_share\vscode_x64.exe" "$install_dir\vscode.exe"
}
else {
Write-Output "[*] Bringing over vscode (x86)"
Copy-Item "$install_share\vscode_x86.exe" "$install_dir\vscode.exe"
}
Write-Output "[*] Installing vscode"
Start-Process -FilePath ".\vscode.exe" -Wait -WorkingDirectory "$install_dir"
# Loop through each VSIX file and install the extension
Write-Output "[*] Bringing over vscode extensions"
Copy-Item "$install_share\*.vsix" "$install_dir"
}
$vsixFiles = Get-ChildItem -Path "$install_dir" -Filter "*.vsix"
if ($vsixFiles.Count -ne 0) {
foreach ($vsixFile in $vsixFiles) {
# Install the extension
Write-Output "[*] Installing vscode extension $($vsixFile.Name)"
Start-Process "$program_files\Microsoft VS Code\bin\code" -ArgumentList "--install-extension", $vsixFile.FullName
}
}
}
Write-Output "[+] Installation complete."