fix(windows): bring the real Windows Ghidra verifiers up to date (#1863)

This commit is contained in:
pablodiazjorge authored and GitHub committed 2026-10-11 23:38:34 +08:00
1 parent fb94d9dde0
commit ea40f717b2
2 files changed
+15 -11

No files matched your search

+8 -5
View File
@@ -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;
+7 -6
View File
@@ -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))