367 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
60 lines
3.0 KiB
PowerShell
60 lines
3.0 KiB
PowerShell
param([string]$OutputDirectory = (Join-Path $PSScriptRoot 'vm-evidence'))
|
|
$ErrorActionPreference = 'Stop'
|
|
New-Item -ItemType Directory -Force -Path $OutputDirectory | Out-Null
|
|
# Documented OS API only: create and release our own temporary D3D devices.
|
|
# No Forever engine calls, process inspection, auth, account or database access.
|
|
Add-Type -TypeDefinition @'
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
public static class WoWHybridD3DProbe {
|
|
[DllImport("d3d11.dll", CallingConvention = CallingConvention.StdCall)]
|
|
private static extern int D3D11CreateDevice(IntPtr adapter, uint driver,
|
|
IntPtr software, uint flags, IntPtr levels, uint count, uint sdk,
|
|
out IntPtr device, out uint feature, out IntPtr context);
|
|
public static string[] Check(uint driver) {
|
|
IntPtr device = IntPtr.Zero, context = IntPtr.Zero;
|
|
uint feature = 0;
|
|
int result = D3D11CreateDevice(IntPtr.Zero, driver, IntPtr.Zero, 0,
|
|
IntPtr.Zero, 0, 7, out device, out feature, out context);
|
|
try { return new string[] { unchecked((uint)result).ToString("X8"), feature.ToString("X4") }; }
|
|
finally {
|
|
if (context != IntPtr.Zero) Marshal.Release(context);
|
|
if (device != IntPtr.Zero) Marshal.Release(device);
|
|
}
|
|
}
|
|
}
|
|
'@
|
|
$hardware = [WoWHybridD3DProbe]::Check(1)
|
|
$warp = [WoWHybridD3DProbe]::Check(5)
|
|
$agent = Get-Service -Name 'qemu-ga' -ErrorAction SilentlyContinue
|
|
$report = [ordered]@{
|
|
schema = 1
|
|
kind = 'windows-vm-prerequisite-probe'
|
|
os = [Environment]::OSVersion.VersionString
|
|
process64bit = [Environment]::Is64BitProcess
|
|
video = @(Get-CimInstance Win32_VideoController | Select-Object Name, DriverVersion, VideoProcessor)
|
|
filesystem_drives = @(Get-PSDrive -PSProvider FileSystem | Select-Object Name, Root, DisplayRoot)
|
|
direct3d11 = @{
|
|
hardware_hresult = $hardware[0]; hardware_feature_level = $hardware[1]
|
|
warp_hresult = $warp[0]; warp_feature_level = $warp[1]
|
|
}
|
|
guest_agent_installed = ($null -ne $agent)
|
|
guest_agent_state = $(if ($agent) { [string]$agent.Status } else { 'absent' })
|
|
client_started = $false
|
|
authentication_attempted = $false
|
|
gameplay_verified = $false
|
|
original_client_modified = $false
|
|
}
|
|
$launcher = Join-Path (Split-Path $PSScriptRoot -Parent) 'WoW-Hybrid-Launcher.exe'
|
|
if (Test-Path $launcher) {
|
|
$process = Start-Process -FilePath $launcher -ArgumentList '--check' -Wait -PassThru -NoNewWindow `
|
|
-RedirectStandardOutput (Join-Path $OutputDirectory 'launcher-check.stdout') `
|
|
-RedirectStandardError (Join-Path $OutputDirectory 'launcher-check.stderr')
|
|
$report.launcher_offline_check_exit = $process.ExitCode
|
|
$report.launcher_sha256 = (Get-FileHash -Algorithm SHA256 $launcher).Hash.ToLowerInvariant()
|
|
}
|
|
$destination = Join-Path $OutputDirectory 'prerequisites.json'
|
|
$report | ConvertTo-Json -Depth 6 | Set-Content -Encoding UTF8 $destination
|
|
$report | ConvertTo-Json -Depth 6
|
|
Write-Host ('Saved local test evidence: ' + $destination)
|