Module BCHMemoryReference

Printing

val memory_base_to_pretty : BCHLibTypes.memory_base_t -> CHPretty.pretty_t
val memory_offset_to_pretty : BCHLibTypes.memory_offset_t -> CHPretty.pretty_t
val memory_offset_to_string : BCHLibTypes.memory_offset_t -> string
val stack_offset_to_name : BCHLibTypes.memory_offset_t -> string
val realigned_stack_offset_to_name : BCHLibTypes.memory_offset_t -> string
val global_offset_to_name : int -> BCHLibTypes.memory_offset_t -> string

Comparison

val memory_offset_compare : BCHLibTypes.memory_offset_t -> BCHLibTypes.memory_offset_t -> int

Offset constructors

val address_memory_offset : ?tgtsize:int option -> ?tgtbtype:BCHBCTypes.btype_t -> BCHBCTypes.btype_t -> XprTypes.xpr_t -> BCHLibTypes.memory_offset_t CHTraceResult.traceresult

address_memory_offset tgtsize tgttype ty offset returns the symbolic offset that corresponds with the numerical offset offset for a base variable with type ty. The optional arguments tgtsize and tgttype can be used to disambiguate between for example an entire struct or only its first field.

An error is returned if the the symbolic offset cannot be constructed.

Offset predicates

val is_constant_offset : BCHLibTypes.memory_offset_t -> bool

Returns true if memoff consists entirely of constant (numerical) values.

val is_field_offset : BCHLibTypes.memory_offset_t -> bool

Returns true if memoff itself or one of its suboffsets is a field offset.

val is_index_offset : BCHLibTypes.memory_offset_t -> bool

Returns true if memoff itself or one of its suboffsets is an index offset.

val is_base_ptr_array_index_offset : BCHLibTypes.memory_offset_t -> bool
val is_unknown_offset : BCHLibTypes.memory_offset_t -> bool

Returns true if memoff itself or one of its suboffsets is an unknown offset.

Offset deconstructors

Returns a list of numerical offset and suboffsets.

Returns an Error if memoff is not a constant_offset.

Returns the sum of all numerical offsets in memoff.

Returns an Error if not all offsets are constant.

val get_index_offset_variables : BCHLibTypes.memory_offset_t -> CHLanguage.variable_t list

Returns the list of index variables in memoff (including suboffsets. Returns the empty list if memoff is not an index offset.

Memory reference manager