fix(ghidra): recover evidenced switch cases and default targets (#579)
Correlate typed labels with recovered block entries and one indirect dispatch. Preserve ambiguous and nonexact integer associations as unknown with raw diagnostics. Expose defaults separately, collect backing load metadata, and invalidate old profiles. Add independent compiler-byte CLI/MCP acceptance and actual Ghidra model controls. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing) Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
This commit is contained in:
@@ -114,6 +114,20 @@ export const ghidraNativeApiBoundary = () => ({
|
||||
],
|
||||
},
|
||||
],
|
||||
default_targets: [
|
||||
{
|
||||
target_address: "0x401030",
|
||||
confidence: "high" as const,
|
||||
evidence: [
|
||||
{
|
||||
kind: "jump-table" as const,
|
||||
source: "ghidra-clang-case-token",
|
||||
detail:
|
||||
"Typed default label belongs to the block at 0x401030 with unique indirect dispatch predecessor 0x401010.",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
limitations: [],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -71,11 +71,18 @@ const jumpTableMappingSchema = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
const jumpTableDefaultTargetSchema = z.strictObject({
|
||||
target_address: z.string().min(1),
|
||||
confidence: inferenceConfidenceSchema,
|
||||
evidence: z.array(inferenceEvidenceSchema).min(1),
|
||||
});
|
||||
|
||||
const inferredJumpTableSchema = z
|
||||
.object({
|
||||
dispatch_address: z.string().min(1),
|
||||
data_sources: z.array(jumpTableDataSourceSchema),
|
||||
mappings: z.array(jumpTableMappingSchema),
|
||||
default_targets: z.array(jumpTableDefaultTargetSchema).default([]),
|
||||
limitations: z.array(z.string()),
|
||||
})
|
||||
.strict();
|
||||
|
||||
Reference in New Issue
Block a user