angr.analyses.decompiler.condition_processor

class angr.analyses.decompiler.condition_processor.AILExprIdAnnotation

Bases: Annotation

An annotation that we use to annotate BVVs so that they are differentiable between other BVVs with the same value and size.

property eliminatable

Returns whether this annotation can be eliminated in a simplification.

Returns:

True if eliminatable, False otherwise

property relocateable
class angr.analyses.decompiler.condition_processor.ConditionProcessor

Bases: object

Convert between claripy AST and AIL expressions. Also calculates reaching conditions of all nodes on a graph.

__init__(arch, ail_manager, condition_mapping=None)
Parameters:

ail_manager (Manager)

clear()
have_opposite_edge_conditions(graph, src, dst0, dst1)

Check if the edge conditions of two edges (src, dst0) and (src, dst1) are opposite to each other. Try to avoid condition translation if possible.

Return type:

bool

Parameters:

graph (DiGraph)

recover_edge_condition(graph, src, dst)
Parameters:

graph (DiGraph)

recover_edge_conditions(region, graph=None)
Return type:

dict

recover_reaching_conditions(region, graph=None, with_successors=False, case_entry_to_switch_head=None, simplify_conditions=True)

Recover the reaching conditions for each block in an acyclic graph. Note that we assume the graph that’s passed in is acyclic.

Parameters:
  • case_entry_to_switch_head (dict[int, int] | None)

  • simplify_conditions (bool)

remove_claripy_bool_asts(node, memo=None)
classmethod get_last_statement(block)

This is the buggy version of get_last_statements, because, you know, there can always be more than one last statement due to the existence of branching statements (like, If-then-else). All methods using get_last_statement() should switch to get_last_statements() and properly handle multiple last statements.

classmethod get_last_statements(block)
Return type:

list[Statement | ConditionalBreakNode | BreakNode | ContinueNode | None]

EXC_COUNTER = 1000
convert_claripy_bool_ast(cond, memo=None)

Convert recovered reaching conditions from claripy ASTs to ailment Expressions

Returns:

None

convert_claripy_bool_ast_core(cond, memo)
claripy_ast_from_ail_condition(condition, *, nobool=False, must_bool=False, ins_addr=0)
Return type:

Bool | Bits

Parameters:
static claripy_ast_to_sympy_expr(ast, memo=None)
static sympy_expr_to_claripy_ast(expr, memo)
Parameters:

memo (dict)

static simplify_condition(cond, depth_limit=8, variables_limit=8)
create_jump_target_var(jumptable_head_addr)
Parameters:

jumptable_head_addr (int)