angr.analyses.decompiler.semantic_naming.region_loop_counter_naming¶
Semantic variable naming for loop counters using structured regions.
This module implements detection and renaming of loop counter variables using the LoopNode structure from the region simplifier. It operates on structured regions after the structuring phase, allowing it to reuse existing loop analysis results instead of re-analyzing the graph.
- class angr.analyses.decompiler.semantic_naming.region_loop_counter_naming.RegionLoopCounterNaming¶
Bases:
RegionNamingBaseDetects loop counter variables from structured LoopNodes and renames them to standard names like i, j, k based on nesting depth.
This pass operates after structuring and uses the iterator information already extracted by LoopSimplifier (stored in LoopNode.iterator).
- __init__(region, variable_manager, functions)¶
- Parameters:
region (BaseNode)
variable_manager (VariableManagerInternal)
functions (FunctionManager)
- analyze()¶
Analyze the structured region for loop counters and return a mapping of variables to their new names.
- Return type:
- Returns:
Dictionary mapping SimVariable to new name (e.g., “i”, “j”, “k”)