pub struct CallGraph {Show 18 fields
pub entry: u64,
pub direct_calls: BTreeMap<u64, u32>,
pub call_continuations: BTreeSet<u64>,
pub call_sites: Vec<CallSite>,
pub tail_calls: BTreeSet<u64>,
pub indirect_calls: u32,
pub indirect_jumps: u32,
pub vcall_slots: BTreeSet<u64>,
pub iat_calls: BTreeSet<u64>,
pub field_offsets: BTreeSet<u64>,
pub globals: BTreeSet<u64>,
pub imm_addrs: BTreeSet<u64>,
pub signed_branches: u32,
pub unsigned_branches: u32,
pub equality_branches: u32,
pub max_end: u64,
pub decode_errors: u32,
pub decode_error_samples: Vec<(u64, Vec<u8>)>,
}Fields§
§entry: u64§direct_calls: BTreeMap<u64, u32>Direct CALL targets → number of call sites hitting that target.
call_continuations: BTreeSet<u64>Fall-through addresses of decoded direct CALL instructions. These are guest return addresses pushed by the instruction, not arbitrary body immediates; operand validation may accept them when a port models the architectural return address explicitly.
call_sites: Vec<CallSite>Per-call-site recovered argument shapes (one entry per direct CALL instruction).
tail_calls: BTreeSet<u64>Direct JMP rel targets that leave the walked body (tail calls).
indirect_calls: u32§indirect_jumps: u32§vcall_slots: BTreeSet<u64>vtable slot displacements seen in CALL/JMP [reg+0xNN].
iat_calls: BTreeSet<u64>IAT import slot addresses seen in CALL [0x00a28xxx].
field_offsets: BTreeSet<u64>Struct-field displacements off a non-stack base register.
globals: BTreeSet<u64>Absolute data addresses referenced as memory operands (globals).
imm_addrs: BTreeSet<u64>In-image immediate values (vtable VAs, fn pointers, string addresses).
signed_branches: u32Conditional-branch polarity (by condition class): signed (JL/JLE/JG/JGE),
unsigned (JB/JBE/JA/JAE), equality (JE/JNE). Other conditions
(JP/JS/JO/...) are not counted. Ground truth for the polarity gap:
the gate checks CFG structure but never == vs != or signed vs
unsigned, so an inverted mirror passes. These counts let ports and
tests pin which class the binary actually uses.
unsigned_branches: u32§equality_branches: u32§max_end: u64Highest instruction-end VA reached — the function’s apparent extent.
decode_errors: u32§decode_error_samples: Vec<(u64, Vec<u8>)>First few decode failures as (ip, raw_bytes). Decoders hitting
invalid opcodes is normal at padding/alignment/data boundaries, but a
long run inside what is supposed to be a function usually means the
entry VA is wrong, or the function crosses into embedded data. The
hex bytes here are enough to tell which.
Implementations§
Source§impl CallGraph
impl CallGraph
pub fn call_targets(&self) -> BTreeSet<u64>
Sourcepub fn footprint(&self) -> BTreeSet<u64>
pub fn footprint(&self) -> BTreeSet<u64>
Every in-image address this function references — call targets, tail-call JMPs, IAT slots, global data refs and baked immediates (vtable VAs / fn pointers / string addresses). Used to detect inlining: if callee C’s whole footprint also appears in caller F’s footprint, the binary pasted C’s body into F, so a Rust call F→C is faithful (un-inlined), not hallucinated.
Sourcepub fn operand_references(&self) -> BTreeSet<u64>
pub fn operand_references(&self) -> BTreeSet<u64>
Addresses the operand gate may accept when a port spells binary facts directly, including architectural return PCs pushed by direct CALLs.