angr.analyses.decompiler.semantic_naming.naming_base

Base class for semantic variable naming patterns.

This module provides two base classes for semantic naming: - ClinicNamingBase: For passes running in Clinic on AIL graphs - RegionNamingBase: For passes running in RegionSimplifier on structured regions

class angr.analyses.decompiler.semantic_naming.naming_base.SemanticNamingBase

Bases: ABC

Abstract base class for semantic variable naming patterns.

Subclasses implement specific naming patterns (loop counters, array indices, etc.) This is the common base for both Clinic-based and RegionSimplifier-based passes.

PRIORITY: int = 100
__init__(variable_manager, functions)
Parameters:
abstractmethod analyze()

Analyze and return a mapping of variables to their suggested names.

Return type:

dict[SimVariable, str]

Returns:

Dictionary mapping SimVariable to suggested name

apply_names(exclude_vars=None)

Apply the computed names to the variables.

Parameters:

exclude_vars (set[SimVariable] | None) – Variables to skip (already named by higher priority patterns)

Return type:

set[SimVariable]

Returns:

Set of variables that were renamed

class angr.analyses.decompiler.semantic_naming.naming_base.ClinicNamingBase

Bases: SemanticNamingBase

Base class for semantic naming passes that run in Clinic on AIL graphs.

These passes operate on the raw AIL graph before structuring, allowing them to analyze control flow patterns directly.

__init__(ail_graph, variable_manager, functions, entry_node)
Parameters:
class angr.analyses.decompiler.semantic_naming.naming_base.RegionNamingBase

Bases: SemanticNamingBase

Base class for semantic naming passes that run in RegionSimplifier on structured regions.

These passes operate after structuring, allowing them to leverage structured information like LoopNode, ConditionNode, etc. They can reuse loop analysis results from structuring instead of re-analyzing the graph.

__init__(region, variable_manager, functions)
Parameters: