Files
rea/src/ghidra/GhidraClientTypes.ts
T
N0zoM1z0andGitHub 4f099a10f8 feat(ghidra): add DOS MZ analysis and complete function extents (#556)
Validate DOS MZ load modules and import them with Ghidra's 16-bit
real-mode profile. Preserve complete observed inclusive function body
ranges through inventory, function analysis, Evidence and snapshots.

Add a public source-generated DOS CLI/MCP verification lane and
regressions for malformed headers, body membership and cache profiles.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
2026-10-05 20:09:45 +08:00

48 lines
1.8 KiB
TypeScript

import type { Logger } from "../logger.js";
import type { Result } from "../domain/result.js";
import type { GhidraLauncher } from "./GhidraLauncher.js";
import type { GhidraSessionError } from "./GhidraSessionError.js";
import type { GhidraSessionInfo } from "./GhidraSessionValues.js";
import type { GhidraTransportKind } from "./GhidraTransport.js";
/** Result of opening and authenticating one headless Ghidra session. */
export type GhidraStartResult = Result<GhidraSessionInfo, GhidraSessionError>;
/** Cancellation and deadline controls shared by authenticated requests. */
export interface GhidraRequestOptions {
readonly signal?: AbortSignal;
/** Internal startup/shutdown deadline; analysis calls have no fixed deadline. */
readonly timeoutMs?: number;
}
/** Safe lifecycle telemetry for one isolated Ghidra headless process. */
export type GhidraDiagnostic =
| {
readonly type: "launcher-output";
readonly stream: "stdout" | "stderr";
readonly bytes: number;
readonly totalBytes: number;
}
| {
readonly type: "launcher-exit";
readonly code: number | null;
readonly signal: NodeJS.Signals | null;
}
| { readonly type: "cleanup-incomplete"; readonly reason: string };
/** Dependencies and exact profile commitment for one headless import. */
export interface GhidraClientOptions {
readonly launcher: GhidraLauncher;
readonly runId?: string;
readonly targetPath: string;
readonly targetSha256: string;
readonly transport?: GhidraTransportKind;
readonly providerVersion: string;
readonly profileDigest: string;
readonly expectedLanguageId?: string;
readonly expectedCompilerSpecId?: string;
readonly startupTimeoutMs?: number;
readonly onDiagnostic?: (event: GhidraDiagnostic) => void;
readonly logger?: Logger;
}