refactor(ghidra): derive reference facts from shared schema

This commit is contained in:
morluto committed 2026-10-22 08:40:36 +08:00
1 parent 1fbfbf74ef
commit 3966c92c71
2 files changed
+6 -21

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ export const functionInstructionWindowSchema = z
})
.strict();
const availableReferenceKindSchema = z
export const availableReferenceKindSchema = z
.object({
available: z.literal(true),
provenance: z.string().min(1),
+5 -20
View File
@@ -18,6 +18,7 @@ import {
functionBodyEntryAgrees,
functionInstructionWindowSchema,
functionDossierSchema,
availableReferenceKindSchema,
type FunctionDossier,
} from "../domain/hopperValues.js";
import {
@@ -139,26 +140,10 @@ const localVariable = z
provenance: z.literal("ghidra-function-database"),
})
.strict();
const referenceKind = z
.object({
available: z.literal(true),
provenance: z.literal("ghidra-reference-manager"),
type: z.string().min(1),
flow: z.boolean(),
call: z.boolean(),
jump: z.boolean(),
data: z.boolean(),
read: z.boolean(),
write: z.boolean(),
indirect: z.boolean(),
computed: z.boolean(),
conditional: z.boolean(),
terminal: z.boolean(),
primary: z.boolean(),
operand_index: z.number().int(),
external: z.boolean(),
})
.strict();
const referenceKind = availableReferenceKindSchema.safeExtend({
provenance: z.literal("ghidra-reference-manager"),
type: z.string().min(1),
});
const referenceEdge = z
.object({
source_address: ghidraCanonicalAddressSchema,