ailment
— angr Intermediate Language¶
- class ailment.Block(addr, original_size, statements=None, idx=None)¶
Bases:
object
Describes an AIL block.
- addr¶
- original_size¶
- idx¶
- copy(statements=None)¶
- likes(other)¶
- class ailment.Assignment(*args, **kwargs)¶
Bases:
Statement
Assignment statement: expr_a = expr_b
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- dst¶
- src¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy() Assignment ¶
- class ailment.Expression(*args, **kwargs)¶
Bases:
TaggedObject
The base class of all AIL expressions.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- depth¶
- has_atom(atom, identity=True)¶
- likes(atom)¶
- replace(old_expr, new_expr)¶
- class ailment.Const(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- value¶
- bits¶
- property size¶
- likes(other)¶
- property sign_bit¶
- class ailment.Tmp(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- tmp_idx¶
- bits¶
- property size¶
- likes(other)¶
- class ailment.Register(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- reg_offset¶
- bits¶
- property size¶
- likes(atom)¶
- class ailment.UnaryOp(*args, **kwargs)¶
Bases:
Op
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- operand¶
- bits¶
- variable¶
- variable_offset¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- property operands¶
- property size¶
- has_atom(atom, identity=True)¶
- class ailment.BinaryOp(*args, **kwargs)¶
Bases:
Op
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- OPSTR_MAP = {'Add': '+', 'AddF': '+', 'And': '&', 'CmpEQ': '==', 'CmpF': 'CmpF', 'CmpGE': '>=', 'CmpGEs': '>=s', 'CmpGT': '>', 'CmpGTs': '>s', 'CmpLE': '<=', 'CmpLEs': '<=s', 'CmpLT': '<', 'CmpLTs': '<s', 'CmpNE': '!=', 'Concat': 'CONCAT', 'Div': '/', 'DivF': '/', 'DivMod': '/m', 'LogicalAnd': '&&', 'LogicalOr': '||', 'Mul': '*', 'MulF': '*', 'Or': '|', 'Sar': '>>a', 'Shl': '<<', 'Shr': '>>', 'Sub': '-', 'SubF': '-', 'Xor': '^'}¶
- COMPARISON_NEGATION = {'CmpEQ': 'CmpNE', 'CmpGE': 'CmpLT', 'CmpGEs': 'CmpLTs', 'CmpGT': 'CmpLE', 'CmpGTs': 'CmpLEs', 'CmpLE': 'CmpGT', 'CmpLEs': 'CmpGTs', 'CmpLT': 'CmpGE', 'CmpLTs': 'CmpGEs', 'CmpNE': 'CmpEQ'}¶
- operands¶
- bits¶
- signed¶
- variable¶
- variable_offset¶
- floating_point¶
- rounding_mode¶
- likes(other)¶
- has_atom(atom, identity=True)¶
- replace(old_expr, new_expr)¶
- property verbose_op¶
- property size¶
- class ailment.Manager(name: str | None = None, arch=None)¶
Bases:
object
- next_atom()¶
- reset()¶
- property ins_addr: int | None¶
- class ailment.IRSBConverter¶
Bases:
Converter
- static convert(irsb, manager)¶
Convert the given IRSB to an AIL block
- Parameters:
irsb – The IRSB to convert
manager – The manager to use
- Returns:
Returns the converted block
- class ailment.VEXIRSBConverter¶
Bases:
Converter
- static convert(irsb, manager)¶
- Parameters:
irsb –
manager –
- Returns:
Converter¶
- exception ailment.converter_common.SkipConversionNotice¶
Bases:
Exception
- class ailment.converter_vex.VEXExprConverter¶
Bases:
Converter
- static simop_from_vexop(vex_op)¶
- static generic_name_from_vex_op(vex_op)¶
- static convert(expr, manager)¶
- Parameters:
expr –
- Returns:
- static convert_list(exprs, manager)¶
- static register(offset, bits, manager)¶
- static tmp(tmp_idx, bits, manager)¶
- static RdTmp(expr, manager)¶
- static Get(expr, manager)¶
- static Load(expr, manager)¶
- static Unop(expr, manager)¶
- static Binop(expr, manager)¶
- static Triop(expr, manager)¶
- static Const(expr, manager)¶
- static const_n(expr, manager)¶
- static ITE(expr, manager)¶
Expressions¶
- class ailment.expression.Expression(*args, **kwargs)¶
Bases:
TaggedObject
The base class of all AIL expressions.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- depth¶
- has_atom(atom, identity=True)¶
- likes(atom)¶
- replace(old_expr, new_expr)¶
- class ailment.expression.Atom(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- variable¶
- variable_offset¶
- copy()¶
- class ailment.expression.Const(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- value¶
- bits¶
- property size¶
- likes(other)¶
- property sign_bit¶
- class ailment.expression.Tmp(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- tmp_idx¶
- bits¶
- property size¶
- likes(other)¶
- class ailment.expression.Register(*args, **kwargs)¶
Bases:
Atom
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- reg_offset¶
- bits¶
- property size¶
- likes(atom)¶
- class ailment.expression.Op(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- op¶
- property verbose_op¶
- class ailment.expression.UnaryOp(*args, **kwargs)¶
Bases:
Op
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- operand¶
- bits¶
- variable¶
- variable_offset¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- property operands¶
- property size¶
- has_atom(atom, identity=True)¶
- class ailment.expression.Convert(*args, **kwargs)¶
Bases:
UnaryOp
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- TYPE_INT = 0¶
- TYPE_FP = 1¶
- from_bits¶
- to_bits¶
- is_signed¶
- from_type¶
- to_type¶
- rounding_mode¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- class ailment.expression.Reinterpret(*args, **kwargs)¶
Bases:
UnaryOp
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- from_bits¶
- from_type¶
- to_bits¶
- to_type¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy() Reinterpret ¶
- class ailment.expression.BinaryOp(*args, **kwargs)¶
Bases:
Op
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- OPSTR_MAP = {'Add': '+', 'AddF': '+', 'And': '&', 'CmpEQ': '==', 'CmpF': 'CmpF', 'CmpGE': '>=', 'CmpGEs': '>=s', 'CmpGT': '>', 'CmpGTs': '>s', 'CmpLE': '<=', 'CmpLEs': '<=s', 'CmpLT': '<', 'CmpLTs': '<s', 'CmpNE': '!=', 'Concat': 'CONCAT', 'Div': '/', 'DivF': '/', 'DivMod': '/m', 'LogicalAnd': '&&', 'LogicalOr': '||', 'Mul': '*', 'MulF': '*', 'Or': '|', 'Sar': '>>a', 'Shl': '<<', 'Shr': '>>', 'Sub': '-', 'SubF': '-', 'Xor': '^'}¶
- COMPARISON_NEGATION = {'CmpEQ': 'CmpNE', 'CmpGE': 'CmpLT', 'CmpGEs': 'CmpLTs', 'CmpGT': 'CmpLE', 'CmpGTs': 'CmpLEs', 'CmpLE': 'CmpGT', 'CmpLEs': 'CmpGTs', 'CmpLT': 'CmpGE', 'CmpLTs': 'CmpGEs', 'CmpNE': 'CmpEQ'}¶
- operands¶
- bits¶
- signed¶
- variable¶
- variable_offset¶
- floating_point¶
- rounding_mode¶
- likes(other)¶
- has_atom(atom, identity=True)¶
- replace(old_expr, new_expr)¶
- property verbose_op¶
- property size¶
- class ailment.expression.TernaryOp(*args, **kwargs)¶
Bases:
Op
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- OPSTR_MAP = {}¶
- operands¶
- bits¶
- likes(other)¶
- has_atom(atom, identity=True)¶
- replace(old_expr, new_expr)¶
- property verbose_op¶
- property size¶
- class ailment.expression.Load(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- addr¶
- size¶
- endness¶
- guard¶
- alt¶
- variable¶
- variable_offset¶
- property bits¶
- has_atom(atom, identity=True)¶
- replace(old_expr, new_expr)¶
- likes(other)¶
- class ailment.expression.ITE(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- cond¶
- iffalse¶
- iftrue¶
- bits¶
- variable¶
- variable_offset¶
- likes(atom)¶
- has_atom(atom, identity=True)¶
- replace(old_expr, new_expr)¶
- property size¶
- class ailment.expression.DirtyExpression(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- dirty_expr¶
- bits¶
- likes(other)¶
- copy() DirtyExpression ¶
- replace(old_expr, new_expr)¶
- property size¶
- class ailment.expression.VEXCCallExpression(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- cee_name¶
- operands¶
- bits¶
- likes(other)¶
- copy() VEXCCallExpression ¶
- replace(old_expr, new_expr)¶
- property size¶
- class ailment.expression.BasePointerOffset(*args, **kwargs)¶
Bases:
Expression
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- bits¶
- base¶
- offset¶
- variable¶
- variable_offset¶
- property size¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy() BasePointerOffset ¶
- class ailment.expression.StackBaseOffset(*args, **kwargs)¶
Bases:
BasePointerOffset
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- copy() StackBaseOffset ¶
Statement¶
- class ailment.statement.Statement(*args, **kwargs)¶
Bases:
TaggedObject
The base class of all AIL statements.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- replace(old_expr, new_expr)¶
- eq(expr0, expr1)¶
- class ailment.statement.Assignment(*args, **kwargs)¶
Bases:
Statement
Assignment statement: expr_a = expr_b
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- dst¶
- src¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy() Assignment ¶
- class ailment.statement.Store(*args, **kwargs)¶
Bases:
Statement
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- addr¶
- data¶
- size¶
- endness¶
- variable¶
- guard¶
- offset¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- class ailment.statement.Jump(*args, **kwargs)¶
Bases:
Statement
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- target¶
- target_idx¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy()¶
- class ailment.statement.ConditionalJump(*args, **kwargs)¶
Bases:
Statement
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- condition¶
- true_target¶
- false_target¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy() ConditionalJump ¶
- class ailment.statement.Call(*args, **kwargs)¶
Bases:
Expression
,Statement
Call is both an expression and a statement. The return expression of a call is defined as the ret_expr if and only if the callee function has one return expression.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- target¶
- calling_convention¶
- prototype¶
- args¶
- ret_expr¶
- fp_ret_expr¶
- likes(other)¶
- property bits¶
- property size¶
- property verbose_op¶
- property op¶
- replace(old_expr, new_expr)¶
- copy()¶
- class ailment.statement.Return(*args, **kwargs)¶
Bases:
Statement
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- target¶
- ret_exprs¶
- likes(other)¶
- replace(old_expr, new_expr)¶
- copy()¶
- class ailment.statement.DirtyStatement(*args, **kwargs)¶
Bases:
Statement
Wrapper around the original statement, which is usually not convertible (temporarily).
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- dirty_stmt¶
- copy() DirtyStatement ¶
- class ailment.statement.Label(*args, **kwargs)¶
Bases:
Statement
A dummy statement that indicates a label with a name.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- name¶
- ins_addr¶
- block_idx¶
Misc. Things¶
- class ailment.block.Block(addr, original_size, statements=None, idx=None)¶
Bases:
object
Describes an AIL block.
- addr¶
- original_size¶
- idx¶
- copy(statements=None)¶
- likes(other)¶
- class ailment.manager.Manager(name: str | None = None, arch=None)¶
Bases:
object
- next_atom()¶
- reset()¶
- property ins_addr: int | None¶
- class ailment.tagged_object.TaggedObject(*args, **kwargs)¶
Bases:
object
A class that takes arbitrary tags.
Create a new instance and set _tags attribute.
Since TaggedObject override __getattr__ method and try to access the _tags attribute, infinite recursion could occur if _tags not ready to exists.
This behavior causes an infinite recursion error when copying TaggedObject with copy.deepcopy.
Hence, we set _tags attribute here to prevent this problem.
- idx¶
- initialize_tags(tags)¶
- property tags: Dict¶
- ailment.utils.get_bits(expr: int | Bits | Expression) int | None ¶
- ailment.utils.stable_hash(t: Tuple) int ¶
- ailment.utils.is_none_or_likeable(arg1, arg2, is_list=False)¶
Returns whether two things are both None or can like each other