angr.analyses.decompiler.structuring.phoenix

exception angr.analyses.decompiler.structuring.phoenix.GraphChangedNotification

Bases: Exception

A notification for graph that is currently worked on being changed. Once this notification is caught, the graph schema matching process for the current region restarts.

class angr.analyses.decompiler.structuring.phoenix.MultiStmtExprMode

Bases: StrEnum

Mode of multi-statement expression creation during structuring.

NEVER = 'Never'
ALWAYS = 'Always'
MAX_ONE_CALL = 'Only when less than one call'
__new__(value)
class angr.analyses.decompiler.structuring.phoenix.GraphEdgeFilter

Bases: object

Filters away edges in a graph that are marked as deleted (outgoing-edges) during cyclic refinement.

__init__(graph)
Parameters:

graph (DiGraph)

class angr.analyses.decompiler.structuring.phoenix.PhoenixStructurer

Bases: StructurerBase

Structure a region using a structuring algorithm that is similar to the one in Phoenix decompiler (described in the “phoenix decompiler” paper). Note that this implementation has quite a few improvements over the original described version and should not be used to evaluate the performance of the original algorithm described in that paper.

NAME: str = 'phoenix'
__init__(region, parent_map=None, condition_processor=None, func=None, case_entry_to_switch_head=None, parent_region=None, improve_algorithm=False, use_multistmtexprs=MultiStmtExprMode.MAX_ONE_CALL, multistmtexpr_stmt_threshold=5, **kwargs)
Parameters:
whitelist_edges: set[tuple[int, int]]
switch_case_known_heads: set[Block | BaseNode]
dowhile_known_tail_nodes: set
replace_nodes(graph, old_node_0, new_node, old_node_1=None, self_loop=True, update_node_order=False, drop_refinement_marks=False)
Parameters:
  • update_node_order (bool)

  • drop_refinement_marks (bool)

static dump_graph(graph, path)
Return type:

None

Parameters:
  • graph (DiGraph)

  • path (str)

static switch_case_entry_node_has_common_successor_case_1(graph, jump_table, case_nodes, node_pred)
Return type:

bool

static switch_case_entry_node_has_common_successor_case_2(graph, jump_table, case_nodes, node_pred)
Return type:

bool