angr.knowledge_plugins.callsite_prototypes

class angr.knowledge_plugins.callsite_prototypes.CallsitePrototypeKind

Bases: Enum

Describes the type of a callsite prototype.

INFERRED = 1
PROPAGATED = 2
MANUAL = 3
class angr.knowledge_plugins.callsite_prototypes.CallsitePrototypes

Bases: KnowledgeBasePlugin

CallsitePrototypes manages callee prototypes at call sites, per decompilation flavor. Every method takes a flavor (None: the default flavor). A non-default flavor reads its own entry of a kind at a call site, or the default flavor’s entry of that kind when it has none, like Function.get_prototype().

__init__(kb)
property flavors: list[str]

The flavors that have entries of their own.

set_prototype(callsite_block_addr, cc, prototype, *, kind=CallsitePrototypeKind.INFERRED, manual=False, propagated=False, flavor=None)
Return type:

None

Parameters:
remove_prototype(callsite_block_addr, *, kind=CallsitePrototypeKind.INFERRED, flavor=None)

Remove the flavor’s own entry of a kind; a non-default flavor then falls back to the default one.

Return type:

None

Parameters:
get_cc(callsite_block_addr, *, kind=CallsitePrototypeKind.INFERRED, flavor=None)
Return type:

SimCC | None

Parameters:
get_prototype(callsite_block_addr, *, kind=CallsitePrototypeKind.INFERRED, flavor=None)
Return type:

SimTypeFunction | None

Parameters:
is_prototype_manual(callsite_block_addr, *, flavor=None)
Return type:

bool | None

Parameters:
  • callsite_block_addr (int)

  • flavor (str | None)

is_prototype_certain(callsite_block_addr, *, flavor=None)
Return type:

bool | None

Parameters:
  • callsite_block_addr (int)

  • flavor (str | None)

has_some_prototype(callsite_block_addr, *, flavor=None)
Return type:

bool

Parameters:
  • callsite_block_addr (int)

  • flavor (str | None)

has_prototype(callsite_block_addr, *, kind=CallsitePrototypeKind.INFERRED, flavor=None)
Return type:

bool

Parameters:
has_prototype_for_flavor(callsite_block_addr, *, kind=CallsitePrototypeKind.INFERRED, flavor=None)

Whether the flavor has its own entry of the kind (as opposed to falling back to the default flavor’s).

Return type:

bool

Parameters:
items(flavor=None)

The flavor’s own entries (no fallback).

Return type:

Iterator[tuple[int, CallsitePrototypeKind, SimCC, SimTypeFunction]]

Parameters:

flavor (str | None)

copy()