feat(ghidra): make the startup deadline configurable (#974)

* feat(ghidra): make the startup deadline configurable

Large binaries (an 8 MB PE with about 20,000 functions) need more than the
fixed 330 s for import and full auto-analysis, so every first request timed
out. REA_GHIDRA_STARTUP_TIMEOUT_MS overrides the deadline in milliseconds;
absent, empty or invalid values keep the 330 s default.

* docs(ghidra): document REA_GHIDRA_STARTUP_TIMEOUT_MS

* fix(ghidra): parse startup deadlines through runtime configuration

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Selim
2026-10-09 07:21:36 +08:00
committed by GitHub
co-authored by morluto
parent 65a809a0da
commit d84bc8f11a
11 changed files with 145 additions and 17 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ import {
type ProviderProcessSnapshot,
ProviderProcessSupervisor,
} from "../process/ProviderProcess.js";
import { GHIDRA_STARTUP_TIMEOUT_MS } from "./GhidraDefaults.js";
import { DEFAULT_GHIDRA_STARTUP_TIMEOUT_MS } from "../config/ghidraStartupTimeout.js";
import type {
GhidraClientOptions,
GhidraRequestOptions,
@@ -124,7 +124,8 @@ export class GhidraClient {
constructor(options: GhidraClientOptions) {
this.#options = {
...options,
startupTimeoutMs: options.startupTimeoutMs ?? GHIDRA_STARTUP_TIMEOUT_MS,
startupTimeoutMs:
options.startupTimeoutMs ?? DEFAULT_GHIDRA_STARTUP_TIMEOUT_MS,
platform: options.platform ?? process.platform,
transport: options.transport ?? "unix-socket",
};