angr.analyses.calling_convention.fact_collector¶
- class angr.analyses.calling_convention.fact_collector.FactCollectorState¶
Bases:
objectThe abstract state for FactCollector.
- __init__()¶
- ins_addr
- reg_reads
- reg_reads_count
- reg_lane_reads: dict[int, int]
widest scalar (<= 8-byte) lane consumed from an FP argument register, directly or through a full-register copy; it narrows a vector-wide read (movaps xmm6, xmm2) to the width the function actually uses
- stack_reads
- stack_reads_fp
- pointer_arg_derefs: defaultdict[FactData, int]
- sp_value
- bp_value
- register_entry_read(offset, size_in_bytes)¶
A read of the register’s function-entry value, already known to precede any write to it.
- class angr.analyses.calling_convention.fact_collector.SimEngineFactCollectorVEX¶
Bases:
SimEngineNostmtVEX[FactCollectorState,FactData,None],SimEngineLight[FactCollectorState,FactData,Block,None]The engine for FactCollector.
- __init__(project, bp_as_gpr, track_arg_uses, seen_reg_uses, seen_reg_pushes)¶
- Parameters:
bp_as_gpr (bool)
track_arg_uses (bool)
seen_reg_uses (defaultdict[int, int])
seen_reg_pushes (defaultdict[int, int])
- seen_reg_pushes
spills or stack-padding pushes
- Type:
stores of a register’s entry value to the stack (push reg)
- process(state, *, block=None, whitelist=None, **kwargs)¶
- class angr.analyses.calling_convention.fact_collector.FactCollector¶
Bases:
AnalysisAn extremely fast analysis that extracts necessary facts of a function for CallingConventionAnalysis to make decision on the calling convention and prototype of a function.
- __init__(func, max_depth=100, track_arg_uses=False, track_arg_passthru=False, flavor=None)¶
- callsites: dict[int, tuple[Function, list[FactData]]]
callsite -> (callee, values passed to each argument of the callee’s prototype, in prototype order)
- pushed_arg_callsites: dict[int, tuple[Function, list[FactData]]]
callsite -> (callee without a usable prototype, values pushed to the outgoing stack). positions are not prototype indices.
- input_args: list[SimRegArg | SimStackArg] | None
- retval_incidental: bool
True when every endpoint’s write to the return register looks like a leftover rather than a return value: the value written is consumed again in the same block (stored, tested, passed on) after the write. A void function whose last instruction happens to load into rax looks exactly like a getter from the outside; this is the one local hint that it is not, and CallingConventionAnalysis only lets call-site evidence demote a prototype to void when it is set.
- pointer_arg_derefs: defaultdict[FactData, int]
- retval_arg: SimRegArg | None
the input argument register whose entry value is in the return register at every return site (an sret-style hidden result pointer, strcpy’s dest, …), or None
- extra_pop: int | None
Number of bytes the callee pops after the return address on the stack, or None if we cannot determine.
- MAX_CONTINUATION_DEPTH = 3¶
- MAX_CALLER_SITES = 16¶