mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 06:46:10 +00:00
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>
30 lines
913 B
TypeScript
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;
|
|
}
|