From ea40f717b26392000f989a8b500f6774b5e85091 Mon Sep 17 00:00:00 2001 From: pablodiazjorge <102741971+pablodiazjorge@users.noreply.github.com> Date: Sun, 11 Oct 2026 17:38:34 +0200 Subject: [PATCH] fix(windows): bring the real Windows Ghidra verifiers up to date (#1863) --- scripts/verify-packaged-ghidra-windows.mjs | 13 ++++++++----- scripts/verify-real-ghidra-windows.mjs | 13 +++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/verify-packaged-ghidra-windows.mjs b/scripts/verify-packaged-ghidra-windows.mjs index 6221c122ca..4dad1b8357 100644 --- a/scripts/verify-packaged-ghidra-windows.mjs +++ b/scripts/verify-packaged-ghidra-windows.mjs @@ -394,15 +394,15 @@ try { return evidence.normalized_result; }, ); - const expected = ( + const { GHIDRA_MUTATING_OPERATIONS, GHIDRA_SESSION_CAPABILITIES } = await import( pathToFileURL(join(packageRoot, "dist/ghidra/GhidraSessionValues.js")) - ) - ).GHIDRA_SESSION_CAPABILITIES.filter( + ); + const expected = GHIDRA_SESSION_CAPABILITIES.filter( (name) => name !== "ping" && name !== "shutdown" && - name !== "annotate_native_function", + !GHIDRA_MUTATING_OPERATIONS.has(name), ); assert.ok( expected.every((name) => report.mcpOperations.includes(name)), @@ -440,7 +440,10 @@ try { token, "Analysis changed caller token authority.", ); - assert.deepEqual((await readdir(callerDirectory)).sort(), scriptCollisions); + assert.deepEqual( + (await readdir(callerDirectory)).sort(), + [...scriptCollisions].sort(), + ); for (const name of scriptCollisions) assert.deepEqual(await readdir(join(callerDirectory, name)), []); report.callerScriptCollisionsPreserved = true; diff --git a/scripts/verify-real-ghidra-windows.mjs b/scripts/verify-real-ghidra-windows.mjs index d2bbb511b6..5adf96009d 100644 --- a/scripts/verify-real-ghidra-windows.mjs +++ b/scripts/verify-real-ghidra-windows.mjs @@ -21,14 +21,17 @@ import { SUPPORTED_GHIDRA_VERSION } from "../dist/ghidra/GhidraInstallationPolic import { GhidraHeadlessLauncher } from "../dist/ghidra/GhidraLauncher.js"; import { GHIDRA_PROVIDER_IDENTITY } from "../dist/ghidra/GhidraProviderCapabilities.js"; import { windowsP0Capabilities } from "../dist/ghidra/GhidraProviderCapabilities.js"; -import { GHIDRA_SESSION_CAPABILITIES } from "../dist/ghidra/GhidraSessionValues.js"; +import { + GHIDRA_MUTATING_OPERATIONS, + GHIDRA_SESSION_CAPABILITIES, +} from "../dist/ghidra/GhidraSessionValues.js"; import { parseBinaryTarget } from "../dist/application/BinaryTargetResolver.js"; import { completeVerifierRun, createVerifierRun } from "./lib/verifier-run.mjs"; import { verifyGhidraCompactReferences } from "./lib/real-ghidra-compact-references.mjs"; const verifierRun = createVerifierRun(); const SESSION_CAPABILITIES = GHIDRA_SESSION_CAPABILITIES.filter( - (name) => name !== "annotate_native_function", + (name) => !GHIDRA_MUTATING_OPERATIONS.has(name), ); if (process.platform !== "win32" || process.arch !== "x64") @@ -236,10 +239,8 @@ try { const expected = [ ...GHIDRA_INVENTORY_OPERATIONS, - ...GHIDRA_FUNCTION_OPERATIONS.filter( - (name) => name !== "annotate_native_function", - ), - ]; + ...GHIDRA_FUNCTION_OPERATIONS, + ].filter((name) => !GHIDRA_MUTATING_OPERATIONS.has(name)); if ( observed.size !== expected.length || expected.some((operation) => !observed.has(operation))