feat: add iSphere live probe recorder

This commit is contained in:
zhaoyilun
2026-07-10 10:59:48 +08:00
parent 349fbe4a44
commit f7914a63dc
13 changed files with 2209 additions and 16 deletions

View File

@@ -61,6 +61,7 @@ $windowsBase = Resolve-Reference "WindowsBase.dll"
/out:$outExe `
/reference:System.dll `
/reference:System.Core.dll `
/reference:System.Management.dll `
/reference:System.Web.Extensions.dll `
/reference:System.Windows.Forms.dll `
/reference:$uiaClient `

View File

@@ -0,0 +1,82 @@
param(
[string]$OutputDir = "runs/live-probe-recorder-package",
[switch]$NoZip
)
$ErrorActionPreference = "Stop"
$repo = Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")
$packageDir = Join-Path $repo $OutputDir
$buildDir = Join-Path $repo "runs/live-probe-recorder-build"
$helperExe = Join-Path $buildDir "ISphereWinHelper.exe"
$recorderExe = Join-Path $packageDir "ISphereLiveProbeRecorder.exe"
New-Item -ItemType Directory -Force -Path $packageDir | Out-Null
& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\build-win-helper.ps1") -OutputDir "runs/live-probe-recorder-build"
if ($LASTEXITCODE -ne 0) {
throw "build-win-helper.ps1 failed with exit code $LASTEXITCODE"
}
if (-not (Test-Path -LiteralPath $helperExe)) {
throw "built helper not found: $helperExe"
}
Copy-Item -LiteralPath $helperExe -Destination $recorderExe -Force
@"
ISphereLiveProbeRecorder
使
1. iSphere/IMPlatformClient
2. iSphere/IMPlatformClient
3. //
4.
5. ISphereLiveProbeRecorder.exe
6. probe-output isphere-live-probe-
7.
-
-
-
- UIA
- //
- exe/dll SHA256
- /
-
-
-
- TCP
-
-
- /
-
- hook
-
"@ | Set-Content -LiteralPath (Join-Path $packageDir "README-使用说明.txt") -Encoding UTF8
@"
@echo off
setlocal
cd /d "%~dp0"
ISphereLiveProbeRecorder.exe
pause
"@ | Set-Content -LiteralPath (Join-Path $packageDir "双击运行-采集.bat") -Encoding ASCII
$zipPath = "$packageDir.zip"
if (-not $NoZip) {
if (Test-Path -LiteralPath $zipPath) {
Remove-Item -LiteralPath $zipPath -Force
}
Compress-Archive -Path (Join-Path $packageDir "*") -DestinationPath $zipPath -Force
}
[ordered]@{
ok = $true
package_dir = (Resolve-Path -LiteralPath $packageDir).Path
recorder_exe = (Resolve-Path -LiteralPath $recorderExe).Path
zip = if (Test-Path -LiteralPath $zipPath) { (Resolve-Path -LiteralPath $zipPath).Path } else { $null }
} | ConvertTo-Json -Depth 4 -Compress

View File

@@ -65,6 +65,21 @@ if (-not $scan.ok -or $null -eq $scan.data.windows) {
throw "scan_windows failed: $($scan | ConvertTo-Json -Depth 8 -Compress)"
}
$runtimeProbe = Invoke-HelperJson @{
protocol = "isphere.helper.v1"
request_id = "verify-runtime-probe"
op = "probe_client_runtime"
timeout_ms = 5000
args = @{
process_names = @("IMPlatformClient", "IMPP.ISphere", "iSphere", "importal")
include_modules = $false
max_modules = 0
}
}
if (-not $runtimeProbe.ok -or $runtimeProbe.data.probe_mode -ne "read_only_process_module_inventory" -or $null -eq $runtimeProbe.data.targets) {
throw "probe_client_runtime failed: $($runtimeProbe | ConvertTo-Json -Depth 8 -Compress)"
}
$dumpMissing = Invoke-HelperJson @{
protocol = "isphere.helper.v1"
request_id = "verify-dump-missing"
@@ -118,5 +133,6 @@ finally {
helper = (Resolve-Path -LiteralPath $helperPath).Path
version = $version.data.helper_version
scan_window_count = $scan.data.windows.Count
runtime_probe_target_count = $runtimeProbe.data.target_count
uia_available = $selfCheck.data.uia_available
} | ConvertTo-Json -Depth 4 -Compress
} | ConvertTo-Json -Depth 4 -Compress