angr.analyses.decompiler.semantic_naming.orchestrator

Orchestrator for semantic variable naming patterns.

This module coordinates multiple naming patterns and applies them in priority order.

Note: Loop counter naming is NOT included here as it runs in RegionSimplifier after structuring, where it can leverage the structured LoopNode information.

class angr.analyses.decompiler.semantic_naming.orchestrator.SemanticNamingOrchestrator

Bases: object

Orchestrates multiple semantic naming patterns.

Runs each pattern in priority order (lower PRIORITY value = runs first). Variables named by higher-priority patterns are not renamed by lower-priority ones.

__init__(ail_graph, variable_manager, functions, entry_node, variable_map=None, patterns=None)
Parameters:
renamed_variables: set[SimVariable]
variable_patterns: dict[SimVariable, str]
original_names: dict[SimVariable, str | None]
analyze()

Run all semantic naming patterns in priority order.

Return type:

dict[SimVariable, str]

Returns:

Combined mapping of all renamed variables to their new names

MAX_SHARED_NAME = 3
resolve_name_collisions()

Suffix duplicate names (len, len1, …) so each variable is unique.

Two distinct variables can get the same name (two strlen -> “len”, or CallResultNaming and PointerNaming both -> “ptr”).

Once a base name has been used MAX_SHARED_NAME times, any further variables that would reuse it are reverted to default (auto-generated) naming: a long run of near-identical names (ptr1 … ptr19) does not help a reader more than the default names would.

Return type:

None