feat(ghidra): integrate optional NativeAOT metadata recovery (#748)

* feat(ghidra): integrate optional NativeAOT metadata recovery

* fix(ghidra): bind extension snapshots to configured artifacts

* test(ghidra): verify lazy NativeAOT startup failures

* fix(ghidra): preserve NativeAOT failure reasons and coverage

* fix(ghidra): preserve NativeAOT x64 calling conventions

* test(ghidra): guard recovered NativeAOT method conventions

* fix(ghidra): reject blocking extension file inputs

* fix(ghidra): diagnose incompatible NativeAOT extension classes

* test(ghidra): verify real extension initialization failures

* fix(ghidra): keep extension descriptor fields optional
This commit is contained in:
N0zoM1z0
2026-10-07 00:57:08 +08:00
committed by GitHub
parent 6d1f39b250
commit fb679b63c2
43 changed files with 2695 additions and 22 deletions
+12
View File
@@ -19,6 +19,10 @@ import {
} from "../process/ProviderProcess.js";
import { ghidraJavaEnvironment } from "./GhidraInstallation.js";
import type { GhidraTransportKind } from "./GhidraTransport.js";
import {
snapshotGhidraExtensions,
type GhidraExtension,
} from "./extensions/GhidraExtensions.js";
/** Private paths and identity material for one headless Ghidra import. */
export interface GhidraLaunchSession {
@@ -66,6 +70,7 @@ export interface GhidraHeadlessLauncherOptions {
/** Select the admitted 16-bit real-mode MZ import instead of auto-detection. */
readonly dosMz?: true;
readonly dosCom?: true;
readonly analysisExtensions?: readonly GhidraExtension[];
}
/** Launch Ghidra without copying scripts into or modifying its installation. */
@@ -83,6 +88,10 @@ export class GhidraHeadlessLauncher implements GhidraLauncher {
let started: SpawnedOwnedProviderProcess | undefined;
try {
await createGhidraRuntimeDirectories(paths, platform);
const extensions = await snapshotGhidraExtensions(
this.options.analysisExtensions ?? [],
session.runtimeRoot,
);
await writeGhidraRuntimeFile(
paths.descriptorPath,
`${JSON.stringify({
@@ -93,6 +102,9 @@ export class GhidraHeadlessLauncher implements GhidraLauncher {
target_sha256: session.targetSha256,
provider_version: session.providerVersion,
profile_digest: session.profileDigest,
...(extensions.length === 0
? {}
: { analysis_extensions: extensions }),
})}\n`,
platform,
);