angr.analyses.decompiler.structured_codegen.base

class angr.analyses.decompiler.structured_codegen.base.CConstantType

Bases: Enum

Describes the value type of a CConstant class.

INT = 0
FLOAT = 1
STRING = 2
class angr.analyses.decompiler.structured_codegen.base.PositionMappingElement

Bases: object

__init__(start, length, obj)
start: int
length: int
obj
class angr.analyses.decompiler.structured_codegen.base.PositionMapping

Bases: object

DUPLICATION_CHECK = True
__init__()
items()
add_mapping(start_pos, length, obj)
get_node(pos)
Parameters:

pos (int)

get_element(pos)
Return type:

PositionMappingElement | None

Parameters:

pos (int)

class angr.analyses.decompiler.structured_codegen.base.InstructionMappingElement

Bases: object

__init__(ins_addr, posmap_pos)
ins_addr: int
posmap_pos: int
class angr.analyses.decompiler.structured_codegen.base.InstructionMapping

Bases: object

__init__()
items()
add_mapping(ins_addr, posmap_pos)
get_nearest_pos(ins_addr)
Return type:

int | None

Parameters:

ins_addr (int)

class angr.analyses.decompiler.structured_codegen.base.BaseStructuredCodeGenerator

Bases: object

__init__(flavor=None, notes=None, expr_comments=None, stmt_comments=None, const_formats=None)
map_ast_to_pos: dict[SimVariable, set[PositionMappingElement]] | None
expr_comments: dict[int, str]
stmt_comments: dict[int, str]
const_formats: dict[tuple[int, int, str], dict[str, bool]]
idx_counters: dict[str, count]
static adjust_mapping_positions(offset, pos_to_node, pos_to_addr, addr_to_pos)

Adjust positions in the mappings to account for the notes that are prepended to the text.

Parameters:
  • offset (int) – The length of the notes to prepend.

  • pos_to_node (PositionMapping) – The position to node mapping.

  • pos_to_addr (PositionMapping) – The position to address mapping.

  • addr_to_pos (InstructionMapping) – The address to position mapping.

Return type:

tuple[PositionMapping, PositionMapping, InstructionMapping]

Returns:

Adjusted mappings.

reapply_options(options)
regenerate_text()
Return type:

None

reload_variable_types()
Return type:

None

next_idx(key)
Return type:

str

Parameters:

key (str)

reset_idx_counters()
Return type:

None