angr.utils.types

angr.utils.types.unpack_typeref(ty)
angr.utils.types.unpack_pointer(ty, iterative=False)
Return type:

SimType | None

Parameters:
angr.utils.types.unpack_pointer_and_array(ty, iterative=False)
Return type:

SimType | None

Parameters:
angr.utils.types.replace_pointer_pts_to(ty, old_pts_to, new_pts_to)
Return type:

SimTypePointer | None

Parameters:
angr.utils.types.unpack_array(ty)
Return type:

SimType | None

angr.utils.types.squash_array_reference(ty)
angr.utils.types.dereference_simtype(t, type_collections, memo=None, keep_missing=False, arch=None)

Replace every SimTypeRef inside t with the real type from type_collections.

When arch is not None, memo holds the with_arch() copies of every dereferenced struct and union. This way we can avoid creating duplicate arch-ed copies of the same type.

Parameters:
Return type:

SimType

angr.utils.types.type_collections_for_lib(libname)

The type collections that prototypes of library libname refer to. Falls back to every loaded type collection when the library is unknown or declares no type collections.

Return type:

list[SimTypeCollection]

Parameters:

libname (str | None)

angr.utils.types.dereference_simtype_by_lib(t, libname)
Return type:

SimType

Parameters:

Replace every TypeRef inside t whose name is in typerefs with the TypeRef object from typerefs, so that deserialized types share the TypeRef objects owned by a TypesStore again. The TypeRef targets themselves are not descended into; t is updated in place.

Return type:

SimType

Parameters:
angr.utils.types.find_type_refs(t, _seen=None)

Collect the names of all SimTypeRef nodes reachable from t.

Return type:

set[str]

Parameters:
angr.utils.types.make_type_reference(t, memo=None, type_collections=None)

Take a SimType and convert named SimStruct instances to SimTypeRefs.

Parameters:
  • t (SimType) – The SimType instance to convert.

  • type_collections (list[SimTypeCollection] | None) – Only structs defined in one of these collections are converted, so that the references can be resolved later. None converts every named struct.

  • memo (dict[str, SimTypeRef] | None)

Return type:

SimType

Returns:

A converted SimType instance.