Files
reverse-engineering-anything/src/config/ghidraExistingProject.ts
T
19447516a4 feat(ghidra): reuse existing projects through verified copies (#7236)
Reuse selected Ghidra projects through verified private read-only copies, with shared CLI/MCP configuration, committed project identity, import-SHA verification and explicit historical/unknown analysis semantics. Preserve exact cancellation and platform capability boundaries.

Actual Ghidra 12.1.4/JDK21 Linux CLI/MCP investigations matched fresh import on 652-function ls and 14,338-function libcrypto inventories and pseudocode; authenticated complete Evidence, mismatch/staleness refusal, saved historical reports and shared /tmp projects verified. 958 focused tests passed with four platform skips; build/static/docs/format passed. Real macOS/Windows reuse remains unverified; Windows reuse is unavailable. See PR verification for measured whole-task costs and final CI attribution.

Co-authored-by: akushonkamen <akushonkamen@163.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-26 22:31:13 +08:00

30 lines
913 B
TypeScript

import { isAbsolute, basename } from "node:path";
import { z } from "zod";
/** A single expanded local project marker; archives must be restored first. */
export const ghidraProjectPathSchema = z
.string()
.min(1)
.refine(isAbsolute, "Ghidra project path must be absolute")
.refine(
(path) => path.endsWith(".gpr") && basename(path).length > 4,
"Select an expanded .gpr project marker; restore .grez archives first",
);
/** Headless -process accepts globs and flags; this workflow selects one root program. */
export const ghidraProgramNameSchema = z
.string()
.min(1)
.refine(
(name) =>
name.trim().length > 0 &&
!name.startsWith("-") &&
!/[\\/\0*?]/u.test(name),
"Select one exact program name in the project root, without paths, flags or wildcards",
);
export interface GhidraProjectSelection {
readonly path: string;
readonly programName?: string;
}