angr.analyses.typehoon.typevars

class angr.analyses.typehoon.typevars.TypeConstraint

Bases: object

pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

class angr.analyses.typehoon.typevars.Equivalence

Bases: TypeConstraint

__init__(type_a, type_b)
type_a
type_b
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

class angr.analyses.typehoon.typevars.Existence

Bases: TypeConstraint

__init__(type_)
type_
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

replace(replacements)
class angr.analyses.typehoon.typevars.Subtype

Bases: TypeConstraint

__init__(sub_type, super_type)
Parameters:
super_type
sub_type
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

replace(replacements)
class angr.analyses.typehoon.typevars.Add

Bases: TypeConstraint

Describes the constraint that type_r == type0 + type1

__init__(type_0, type_1, type_r)
type_0
type_1
type_r
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

replace(replacements)
class angr.analyses.typehoon.typevars.Sub

Bases: TypeConstraint

Describes the constraint that type_r == type0 - type1

__init__(type_0, type_1, type_r)
type_0
type_1
type_r
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

replace(replacements)
class angr.analyses.typehoon.typevars.TypeVariableManager

Bases: object

A manager for creating new type variables and derived type variables and keeping track of their indices.

Usually we create a new TypeVariableManager for each function we analyze.

__init__(func_addr, idx=0)
Parameters:
next_id()
Return type:

int

property max_tv_id: int
new_tv(name=None)

Create a new TypeVariable with a managed ID.

Return type:

TypeVariable

Parameters:

name (str | None)

new_dtv(type_var, *, label=None, labels=None)

Create a new DerivedTypeVariable with a managed ID.

Return type:

TypeVariable | DerivedTypeVariable | TypeConstant

Parameters:
new_dtv_with_merged_labels(type_var, *, label=None, labels=None)

Create a new DerivedTypeVariable with the given type variable (or DerivedTypeVariable) and labels. Merge the last AddN and SubN labels when possible.

Return type:

TypeVariable | DerivedTypeVariable | TypeConstant

Parameters:
class angr.analyses.typehoon.typevars.TypeVariable

Bases: object

__init__(idx=None, name=None)
Parameters:
idx: tuple[int, int]
name
pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

class angr.analyses.typehoon.typevars.DerivedTypeVariable

Bases: TypeVariable

__init__(type_var, label, labels=None, idx=None)
Parameters:
type_var: TypeVariable | TypeConstant
labels: tuple[BaseLabel, ...]
one_label()
Return type:

BaseLabel | None

first_label()
Return type:

BaseLabel

path()
Return type:

tuple[BaseLabel, ...]

longest_prefix()
Return type:

Union[TypeConstant, TypeVariable, DerivedTypeVariable, None]

pp_str(mapping)
Return type:

str

Parameters:

mapping (dict[TypeVariable, Any])

replace(replacements)
class angr.analyses.typehoon.typevars.TypeVariables

Bases: object

__init__()
copy()
add_type_variable(var, typevar, latest=True)
Parameters:
get_type_variable(var)
has_type_variable_for(var)
Parameters:

var (SimVariable)

typevar_to_variable(typevar)
Return type:

SimVariable | None

Parameters:

typevar (TypeVariable)

class angr.analyses.typehoon.typevars.BaseLabel

Bases: object

__init__()
property variance: Variance
class angr.analyses.typehoon.typevars.FuncIn

Bases: BaseLabel

__init__(loc)
loc
class angr.analyses.typehoon.typevars.FuncOut

Bases: BaseLabel

__init__(loc)
loc
class angr.analyses.typehoon.typevars.Load

Bases: BaseLabel

class angr.analyses.typehoon.typevars.Store

Bases: BaseLabel

property variance: Variance
class angr.analyses.typehoon.typevars.AddN

Bases: BaseLabel

__init__(n)
n
class angr.analyses.typehoon.typevars.SubN

Bases: BaseLabel

__init__(n)
n
class angr.analyses.typehoon.typevars.ConvertTo

Bases: BaseLabel

__init__(to_bits)
to_bits
class angr.analyses.typehoon.typevars.ReinterpretAs

Bases: BaseLabel

__init__(to_type, to_bits)
to_type
to_bits
class angr.analyses.typehoon.typevars.HasField

Bases: BaseLabel

Has a field of the given bit size * elem_count at the given offset.

__init__(bits, offset, elem_count=1)
Parameters:

elem_count (int)

bits
offset
elem_count
class angr.analyses.typehoon.typevars.IsArray

Bases: BaseLabel