* fix(ghidra): report unapplied PE CodeView PDB limitation (#2259) When Ghidra analyzes a PE target that references companion debug symbols in its CodeView (IMAGE_DEBUG_TYPE_CODEVIEW / RSDS or NB10) debug directory, Ghidra's headless analyzer cannot automatically locate or apply the companion PDB from isolated runtime directories without companion admission. Procedure names remain analysis-generated (FUN_<address>). Parse CodeView debug metadata (RSDS GUID/age and NB10 age) during PE target resolution, and report an Evidence limitation informing callers and agents that referenced debug symbols were not applied and procedure names are analysis-generated. Fixes #2259 * test(pe): group CodeView header coverage separately * fix(ghidra): avoid contradictory PDB limitations * fix(android): make DEX descriptor pattern portable * fix(ci): isolate Linux Hopper process fixture inventory * fix(comparison): recheck historical calls-only changes (#2223) * fix(comparison): preserve incomplete function call evidence Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty. Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls. * fix(comparison): recheck historical calls-only changes --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> * style: format identity comparison and IDA runner --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: Lucien <164857476+dakjdakd@users.noreply.github.com>
96 lines
3.0 KiB
TypeScript
96 lines
3.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { BinaryTarget } from "../domain/binaryTargetTypes.js";
|
|
import { ghidraPeCodeViewLimitations } from "./GhidraPeProfile.js";
|
|
|
|
describe("ghidraPeCodeViewLimitations", () => {
|
|
it("returns empty limitations for non-PE targets", () => {
|
|
const elfTarget: BinaryTarget = {
|
|
path: "/test/file",
|
|
sha256: "abc",
|
|
kind: "executable",
|
|
format: "elf",
|
|
architecture: "x86_64",
|
|
availableArchitectures: ["x86_64"],
|
|
};
|
|
expect(ghidraPeCodeViewLimitations(elfTarget)).toEqual([]);
|
|
});
|
|
|
|
it("does not claim CodeView symbols were unapplied when the session loaded a PDB", () => {
|
|
const peTarget: BinaryTarget = {
|
|
path: "/test/file.exe",
|
|
sha256: "abc",
|
|
kind: "executable",
|
|
architecture: "x86_64",
|
|
availableArchitectures: ["x86_64"],
|
|
executableRole: "application",
|
|
managed: false,
|
|
format: "pe",
|
|
codeView: {
|
|
pdbPath: "C:\\symbols.pdb",
|
|
pdbFileName: "symbols.pdb",
|
|
guid: "12345678-1234-1234-1234-123456789abc",
|
|
age: 1,
|
|
},
|
|
};
|
|
expect(ghidraPeCodeViewLimitations(peTarget, true)).toEqual([]);
|
|
});
|
|
|
|
it("returns empty limitations for PE target without codeView", () => {
|
|
const peTarget: BinaryTarget = {
|
|
path: "/test/file.exe",
|
|
sha256: "def",
|
|
kind: "executable",
|
|
format: "pe",
|
|
architecture: "x86_64",
|
|
availableArchitectures: ["x86_64"],
|
|
executableRole: "application",
|
|
managed: false,
|
|
};
|
|
expect(ghidraPeCodeViewLimitations(peTarget)).toEqual([]);
|
|
});
|
|
|
|
it("returns limitation with GUID and age for RSDS CodeView records", () => {
|
|
const peTarget: BinaryTarget = {
|
|
path: "/test/file.exe",
|
|
sha256: "def",
|
|
kind: "executable",
|
|
format: "pe",
|
|
architecture: "x86_64",
|
|
availableArchitectures: ["x86_64"],
|
|
executableRole: "application",
|
|
managed: false,
|
|
codeView: {
|
|
pdbPath: "C:\\build\\app.pdb",
|
|
pdbFileName: "app.pdb",
|
|
guid: "01234567-89ab-cdef-0123-456789abcdef",
|
|
age: 1,
|
|
},
|
|
};
|
|
expect(ghidraPeCodeViewLimitations(peTarget)).toEqual([
|
|
'The target references debug symbols "app.pdb" (GUID 01234567-89ab-cdef-0123-456789abcdef, age 1) that were not applied; procedure names are analysis-generated.',
|
|
]);
|
|
});
|
|
|
|
it("returns limitation without GUID for NB10 CodeView records", () => {
|
|
const peTarget: BinaryTarget = {
|
|
path: "/test/file.exe",
|
|
sha256: "def",
|
|
kind: "executable",
|
|
format: "pe",
|
|
architecture: "x86",
|
|
availableArchitectures: ["x86"],
|
|
executableRole: "application",
|
|
managed: false,
|
|
codeView: {
|
|
pdbPath: "D:\\test\\legacy.pdb",
|
|
pdbFileName: "legacy.pdb",
|
|
guid: null,
|
|
age: 2,
|
|
},
|
|
};
|
|
expect(ghidraPeCodeViewLimitations(peTarget)).toEqual([
|
|
'The target references debug symbols "legacy.pdb" (age 2) that were not applied; procedure names are analysis-generated.',
|
|
]);
|
|
});
|
|
});
|