angr.go.sim_type

Go-flavored SimTypes.

Every class carries an optional go_name (the declared name of a named type such as time.Duration), which is what gets rendered; the underlying representation decides size, layout and how values are passed.

class angr.go.sim_type.GoSimType

Bases: SimType

go_name: str | None = None
go_repr()

The canonical Go spelling of this type (its name when it is a named type).

Return type:

str

repr(name=None, full=0, memo=None, indent=0)
Parameters:

indent (int | None)

c_repr(name=None, full=0, memo=None, indent=0, name_parens=True, show_void=True, **kwargs)
Parameters:
  • indent (int | None)

  • name_parens (bool)

  • show_void (bool)

class angr.go.sim_type.GoSimTypeInt

Bases: GoSimType, SimTypeInt

An integer of explicit width. go_name distinguishes int/uintptr/rune from int64/uint64/ int32.

property size: int

The size of the type in bits, or None if no size is computable.

property alignment

The alignment of the type in bytes.

copy()
Return type:

Self

class angr.go.sim_type.GoSimTypeBool

Bases: GoSimTypeInt

copy()
Return type:

Self

class angr.go.sim_type.GoSimTypeFloat

Bases: GoSimType, SimTypeFloat

property size: int

The size of the type in bits, or None if no size is computable.

property sort
copy()
Return type:

GoSimTypeFloat

class angr.go.sim_type.GoSimTypePointer

Bases: GoSimType, SimTypePointer

property size

The size of the type in bits, or None if no size is computable.

copy()
Return type:

GoSimTypePointer

class angr.go.sim_type.GoSimTypeUnsafePointer

Bases: GoSimTypePointer

copy()
Return type:

GoSimTypeUnsafePointer

class angr.go.sim_type.GoSimTypeArray

Bases: GoSimType, SimTypeArray

A fixed-size Go array [N]T.

copy()
Return type:

GoSimTypeArray

class angr.go.sim_type.GoSimStruct

Bases: GoSimType, SimStruct

A Go struct. go_name is the qualified type name (main.point); anonymous structs have none. Field offsets and the total size may be pinned (offsets/go_size) when they come from a trusted source such as DWARF, so the layout never depends on angr’s C-style alignment rules.

go_size: int | None
property name: str
property offsets: dict[str, int]
property size

The size of the type in bits, or None if no size is computable.

property alignment

The alignment of the type in bytes.

go_definition_lines()

Field lines of a type X struct { ... } definition.

Return type:

list[str]

copy()
Return type:

GoSimStruct

class angr.go.sim_type.GoSimTypeString

Bases: GoSimStruct

property name: str
class angr.go.sim_type.GoSimTypeSlice

Bases: GoSimStruct

property name: str
class angr.go.sim_type.GoSimTypeInterface

Bases: GoSimStruct

An interface value: an itab (or type) pointer and a data pointer. methods is a list of (name, func_type); the empty method set is any.

methods: list[tuple[str, SimType]]
property name: str
property is_empty: bool
class angr.go.sim_type.GoSimTypeTuple

Bases: GoSimStruct

The result list of a function with more than one result, laid out like a struct.

property name: str
class angr.go.sim_type.GoSimTypeMap

Bases: GoSimTypePointer

copy()
Return type:

GoSimTypeMap

class angr.go.sim_type.GoSimTypeChan

Bases: GoSimTypePointer

copy()
Return type:

GoSimTypeChan

class angr.go.sim_type.GoSimTypeFunction

Bases: GoSimType, SimTypeFunction

A function signature: parameters (named) and results. More than one result is a GoSimTypeTuple return type so calling-convention code sees one struct-shaped value.

property results: list[SimType]
property result_names: list[str]
go_results_repr()
Return type:

str

repr(name=None, full=0, memo=None, indent=0)
Parameters:

indent (int | None)

copy()
Return type:

GoSimTypeFunction

class angr.go.sim_type.GoSimTypeFunc

Bases: GoSimTypePointer

A func value: a pointer to a closure whose first word is the code pointer.

copy()
Return type:

GoSimTypeFunc

angr.go.sim_type.go_type_repr(ty)

Spell any SimType the Go way; non-Go SimTypes get a best-effort mapping.

Return type:

str

Parameters:

ty (SimType | None)

angr.go.sim_type.go_int(arch, size=None, signed=True, go_name=None)
Return type:

GoSimTypeInt

Parameters:
  • size (int | None)

  • signed (bool)

  • go_name (str | None)