angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier¶
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.CmpOp¶
Bases:
EnumAll supported comparison operators.
- LT = 0¶
- GT = 1¶
- EQ = 2¶
- NE = 3¶
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.ConditionalRegion¶
Bases:
objectDescribes a conditional region.
- __init__(variable, op, value, node, parent=None)¶
- Parameters:
op (CmpOp)
value (int)
node (ConditionNode | Block)
- variable
- op
- value
- node
- parent
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.SwitchCaseRegion¶
Bases:
objectDescribes an already-recovered switch region.
- __init__(variable, node, parent=None)¶
- Parameters:
node (SwitchCaseNode)
- variable
- node
- parent
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.SwitchClusterFinder¶
Bases:
SequenceWalkerFind comparisons and switches in order to identify switch clusters.
- __init__(node)¶
- var2condnodes: defaultdict[Any, list[ConditionalRegion]]
- var2switches: defaultdict[Any, list[SwitchCaseRegion]]
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.SwitchClusterReplacer¶
Bases:
SequenceWalkerReplace an identified switch cluster with a newly created SwitchCase node.
- __init__(region, to_replace, replace_with)¶
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.is_simple_jump_node(node, case_addrs, targets=None)¶
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.filter_cond_regions(cond_regions, case_addrs)¶
Remove all conditional regions that cannot be merged into switch(es).
- Return type:
- Parameters:
cond_regions (list[ConditionalRegion])
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.update_switch_case_list(cases, old_case_id, new_case_id)¶
Update cases in-place. Make new_case_id directly jump to old_case_id.
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.simplify_switch_clusters(region, var2condnodes, var2switches)¶
Identify switch clusters and simplify each of them.
- Parameters:
region – The region to simplify.
var2condnodes (
dict[Any,list[ConditionalRegion]]) – A dict that stores the mapping from (potential) switch variables to conditional regions.var2switches (
dict[Any,list[SwitchCaseRegion]]) – A dict that stores the mapping from switch variables to switch-case regions.
- Returns:
None
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.simplify_lowered_switches(region, var2condnodes, functions, ail_manager)¶
Identify a lowered switch and simplify it into a switch-case if possible.
- Parameters:
region (
SequenceNode) – The region to simplify.var2condnodes (
dict[Any,list[ConditionalRegion]]) – A dict that stores the mapping from (potential) switch variables to conditional regions.ail_manager (Manager)
- Returns:
None
- angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.simplify_lowered_switches_core(region, var, condnodes, functions, ail_manager)¶
- Return type:
- Parameters:
region (SequenceNode)
ail_manager (Manager)
- class angr.analyses.decompiler.region_simplifiers.switch_cluster_simplifier.FindFirstNodeInSet¶
Bases:
SequenceWalkerFind the first node out of a set of node appearing in a SequenceNode (and its tree).