angr.storage.memory_mixins.regioned_memory

class angr.storage.memory_mixins.regioned_memory.AbstractMergerMixin

Bases: MemoryMixin

AbstractMergerMixin handles merging initialized values.

class angr.storage.memory_mixins.regioned_memory.MemoryRegionMetaMixin

Bases: MemoryMixin

__init__(related_function_addr=None, **kwargs)
property is_stack
property related_function_addr
get_abstract_locations(addr, size)

Get a list of abstract locations that is within the range of [addr, addr + size]

This implementation is pretty slow. But since this method won’t be called frequently, we can live with the bad implementation for now.

Parameters:
  • addr – Starting address of the memory region.

  • size – Size of the memory region, in bytes.

Returns:

A list of covered AbstractLocation objects, or an empty list if there is none.

store(addr, data, size=None, *, bbl_addr=None, stmt_id=None, ins_addr=None, endness=None, **kwargs)
load(addr, size=None, *, bbl_addr=None, stmt_idx=None, ins_addr=None, **kwargs)
dbg_print(indent=0)

Print out debugging information

class angr.storage.memory_mixins.regioned_memory.RegionCategoryMixin

Bases: MemoryMixin

property category

reg, mem, or file.

Type:

Return the category of this SimMemory instance. It can be one of the three following categories

class angr.storage.memory_mixins.regioned_memory.RegionedAddressConcretizationMixin

Bases: MemoryMixin

__init__(read_strategies=None, write_strategies=None, **kwargs)
class angr.storage.memory_mixins.regioned_memory.RegionedMemoryMixin

Bases: MemoryMixin

Regioned memory. This mixin manages multiple memory regions. Each address is represented as a tuple of (region ID, offset into the region), which is called a regioned address.

Converting absolute addresses into regioned addresses: We map an absolute address to a region by looking up which region this address belongs to in the region map. Currently this is only enabled for stack. Heap support has not landed yet.

When start analyzing a function, the user should call set_stack_address_mapping() to create a new region mapping. Likewise, when exiting from a function, the user should cancel the previous mapping by calling unset_stack_address_mapping().

__init__(write_targets_limit=2048, read_targets_limit=4096, stack_region_map=None, generic_region_map=None, stack_size=65536, cle_memory_backer=None, dict_memory_backer=None, regioned_memory_cls=None, **kwargs)
load(addr, size=None, *, endness=None, condition=None, **kwargs)
Parameters:
  • size (BV | int | None)

  • condition (Bool | None)

store(addr, data, size=None, *, endness=None, **kwargs)
Parameters:

size (int | None)

find(addr, data, max_search, **kwargs)
Parameters:

addr (int | Bits)

replace_all(old, new)
Parameters:
set_stack_address_mapping(absolute_address, region_id, related_function_address=None)

Create a new mapping between an absolute address (which is the base address of a specific stack frame) and a region ID.

Parameters:
  • absolute_address (int) – The absolute memory address.

  • region_id (str) – The region ID.

  • related_function_address (int | None) – Related function address.

unset_stack_address_mapping(absolute_address)

Remove a stack mapping.

Parameters:

absolute_address (int) – An absolute memory address that is the base address of the stack frame to destroy.

stack_id(function_address)

Return a memory region ID for a function. If the default region ID exists in the region mapping, an integer will appended to the region name. In this way we can handle recursive function calls, or a function that appears more than once in the call frame.

This also means that stack_id() should only be called when creating a new stack frame for a function. You are not supposed to call this function every time you want to map a function address to a stack ID.

Parameters:

function_address (int) – Address of the function.

Return type:

str

Returns:

ID of the new memory region.

set_stack_size(size)
Parameters:

size (int)

class angr.storage.memory_mixins.regioned_memory.StaticFindMixin

Bases: SmartFindMixin

Implements data finding for abstract memory.

find(addr, data, max_search, *, default=None, endness=None, chunk_size=None, max_symbolic_bytes=None, condition=None, char_size=1, **kwargs)

Submodules