fix(ghidra): admit carved MIPS ELF with incomplete section tables (#1629)

* fix(ghidra): inspect carved MIPS ABI declarations without missing sections

* test: share filesystem fixtures and cleanup assertions
This commit is contained in:
Ysopwnable
2026-10-11 04:33:05 +08:00
committed by GitHub
parent bbd01923e9
commit d6f698d8af
9 changed files with 313 additions and 116 deletions
+7 -1
View File
@@ -31,7 +31,10 @@ export const ghidraMipsUnsupportedReason = (
return "EF_MIPS_NAN2008 requires separate verification of NaN encoding semantics in this Ghidra lane.";
const abi = metadata.abiFlags;
if (abi === undefined || abi === null)
return "This Ghidra MIPS lane requires an inspected ABI flags record; header flags alone do not establish the floating-point ABI.";
return [
"This Ghidra MIPS lane requires an inspected ABI flags record; header flags alone do not establish the floating-point ABI.",
...(metadata.limitations ?? []),
].join(" ");
if (abi.version !== 0)
return "This Ghidra MIPS lane requires ABI flags version 0; newer record semantics are unsupported.";
if (abi.isaLevel !== 32 || abi.isaRevision !== 2)
@@ -64,6 +67,9 @@ export const ghidraMipsProfileParameters = (
byte_order: target.mips.byteOrder,
type: target.mips.type,
flags: target.mips.flags,
...(target.mips.limitations === undefined
? {}
: { abi_flags_limitations: [...target.mips.limitations] }),
abi_flags:
abi === undefined || abi === null
? null
+7 -3
View File
@@ -117,13 +117,17 @@ export const createGhidraProviderClient = (input: {
}),
);
let extensionFailure: AnalysisError | undefined;
const targetLimitations =
target.format === "dos-mz"
const targetLimitations = [
...(target.format === "dos-mz"
? [
"DOS MZ uses 16-bit x86 real mode with the Ghidra load segment 0x1000. Returned addresses are linear byte coordinates; they do not identify a unique segment:offset alias.",
"Static DOS analysis does not emulate BIOS, DOS interrupts, device ports, or self-modifying unpacking code. Packed targets require a separately identified unpacked artifact for original-program analysis; appended overlays are not the initialized load module.",
]
: [];
: []),
...(target.kind === "executable" && target.architecture === "mips"
? (target.mips.limitations ?? [])
: []),
];
const providerLimitations =
installation.platform === "win32"
? windowsP0Limitations