angr.analyses.purity.engine

class angr.analyses.purity.engine.DataUsage

Bases: object

Facts about a given data source

ptr_load: bool = False
ptr_store: bool = False
__init__(ptr_load=False, ptr_store=False)
Parameters:
Return type:

None

class angr.analyses.purity.engine.DataSource

Bases: object

Descriptor of a given data source: where did this value come from?

constant_value: int | None = None
function_arg: int | None = None
callee_return: Function | str | None = None
reference_to: int | None = None
property callee_return_name: str | None
__init__(constant_value=None, function_arg=None, callee_return=None, reference_to=None)
Parameters:
  • constant_value (int | None)

  • function_arg (int | None)

  • callee_return (Function | str | None)

  • reference_to (int | None)

Return type:

None

class angr.analyses.purity.engine.StateType

Bases: object

Internal state for purity analysis

addr: tuple[int, int | None]
vars: MutableMapping[int, DataType_co]
copy()
__init__(addr, vars)
Parameters:
Return type:

None

class angr.analyses.purity.engine.ResultType

Bases: object

Result of purity analysis - how was each data source used and what function calls arguments were passed?

uses: MutableMapping[DataSource, DataUsage]
call_args: MutableMapping[tuple[int, int | None, int, Function | str | None, int], DataType_co]
ret_vals: MutableMapping[int, DataType_co]
other_storage: MutableMapping[DataSource, DataType_co]
update(other)
Parameters:

other (Self)

is_pure(pure_functions=None, allow_read_arguments=True, allow_write_arguments=False, allow_read_globals=True, allow_write_globals=False)
Return type:

bool

Parameters:
  • pure_functions (set[str] | None)

  • allow_read_arguments (bool)

  • allow_write_arguments (bool)

  • allow_read_globals (bool)

  • allow_write_globals (bool)

__init__(uses=<factory>, call_args=<factory>, ret_vals=<factory>, other_storage=<factory>)
Parameters:
Return type:

None

type angr.analyses.purity.engine.DataType_co = frozenset[DataSource]
type angr.analyses.purity.engine.StmtDataType = None
class angr.analyses.purity.engine.PurityEngineAIL

Bases: SimEngineLightAIL[StateType, DataType_co, StmtDataType, ResultType]

Core of this analysis: THIS data source has THESE uses.

A use is arithmetic, store, or load.

__init__(project, clinic, recurse)
Parameters:
initial_state(node)
Parameters:

node (Block)

process(state, *, block=None, whitelist=None, **kwargs)
Return type:

ResultType

Parameters: