Files
reverse-engineering-anything/tests/ghidraWindowsFixture.test.ts
N0zoM1z0 0b3551076d ci(ghidra): add Windows P0 acceptance and real-engine lanes
Add a hosted Windows x64 lane for named host capabilities, portable provider tests, and packed CLI/MCP verification. Add a default-branch-only repository-dispatch workflow for a controlled self-hosted Ghidra 12.1.2 runner, backed by a deterministic source-owned native PE fixture and a verifier that exercises all 18 admitted operations, target digest linkage, authenticated loopback transport, and complete runtime cleanup.
2026-07-17 03:05:19 +09:00

38 lines
1.3 KiB
TypeScript

import { execFile } from "node:child_process";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { promisify } from "node:util";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
import { parseExecutableHeader } from "../src/domain/binaryTarget.js";
const exec = promisify(execFile);
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const generator = resolve(root, "scripts", "create-ghidra-windows-fixture.mjs");
const fixture = resolve(root, "build", "fixtures", "rea-ghidra-windows.exe");
const expectedSha256 =
"732ec6083ae3b63bcbda33f2d0fd7e1a6539babade07cbdae4fc20d3394faf49";
describe("controlled Windows Ghidra fixture", () => {
it("generates one deterministic native x86-64 PE application", async () => {
await exec(process.execPath, [generator]);
const bytes = await readFile(fixture);
expect(createHash("sha256").update(bytes).digest("hex")).toBe(
expectedSha256,
);
expect(parseExecutableHeader(bytes, "x64")).toMatchObject({
ok: true,
value: {
format: "pe",
architecture: "x86_64",
executableRole: "application",
managed: false,
},
});
});
});