angr.storage.memory_mixins.paged_memory.pages

class angr.storage.memory_mixins.paged_memory.pages.CooperationBase

Bases: Generic

Any given subclass of this class which is not a subclass of MemoryMixin should have the property that any subclass it which is a subclass of MemoryMixin should all work with the same datatypes

class angr.storage.memory_mixins.paged_memory.pages.HistoryTrackingMixin

Bases: RefcountMixin, MemoryMixin

Tracks the history of memory writes.

__init__(*args, **kwargs)
store(addr, data, size=None, **kwargs)
parents()
changed_bytes(other, **kwargs)
Return type:

set[int] | None

all_bytes_changed_in_history()
Return type:

SegmentList

class angr.storage.memory_mixins.paged_memory.pages.ISPOMixin

Bases: MemoryMixin

An implementation of the International Stateless Persons Organisation, a mixin which should be applied as a bottom layer for memories which have no state and must redirect certain operations to a parent memory. Main usecase is for memory region classes which are stored within other memories, such as pages.

class angr.storage.memory_mixins.paged_memory.pages.ListPage

Bases: MemoryObjectMixin, PageBase

This class implements a page memory mixin with lists as the main content store.

__init__(memory=None, content=None, sinkhole=None, mo_cmp=None, **kwargs)
load(addr, size=None, endness=None, page_addr=None, memory=None, cooperate=False, **kwargs)
store(addr, data, size=None, endness=None, memory=None, cooperate=False, **kwargs)
changed_bytes(other, page_addr=None)
Parameters:
class angr.storage.memory_mixins.paged_memory.pages.MVListPage

Bases: MemoryObjectSetMixin, PageBase

MVListPage allows storing multiple values at the same location.

Each store() may take a value or multiple values. Each load() returns an iterator of all values stored at that location.

__init__(memory=None, content=None, sinkhole=None, mo_cmp=None, **kwargs)
load(addr, size=None, endness=None, page_addr=None, memory=None, cooperate=False, **kwargs)
Return type:

list[tuple[int, SimMemoryObject | SimLabeledMemoryObject]]

store(addr, data, size=None, endness=None, memory=None, cooperate=False, **kwargs)
compare(other, page_addr=None, memory=None, changed_offsets=None)
Return type:

bool

Parameters:
changed_bytes(other, page_addr=None)
Parameters:
content_gen(index)
class angr.storage.memory_mixins.paged_memory.pages.MemoryObjectMixin

Bases: CooperationBase[SimMemoryObject]

Uses SimMemoryObjects in region storage. With this, load will return a list of tuple (address, MO) and store will take a MO.

class angr.storage.memory_mixins.paged_memory.pages.PageBase

Bases: HistoryTrackingMixin, RefcountMixin, CooperationBase, ISPOMixin, PermissionsMixin, MemoryMixin

This is a fairly succinct definition of the contract between PagedMemoryMixin and its constituent pages:

  • Pages must implement the MemoryMixin model for loads, stores, copying, merging, etc

  • However, loading/storing may not necessarily use the same data domain as PagedMemoryMixin. In order to do more efficient loads/stores across pages, we use the CooperationBase interface which allows the page class to determine how to generate and unwrap the objects which are actually stored.

  • To support COW, we use the RefcountMixin and the ISPOMixin (which adds the contract element that memory=self be passed to every method call)

  • Pages have permissions associated with them, stored in the PermissionsMixin.

Read the docstrings for each of the constituent classes to understand the nuances of their functionalities

class angr.storage.memory_mixins.paged_memory.pages.PermissionsMixin

Bases: MemoryMixin

This mixin adds a permissions_bits field and properties for extracting the read/write/exec permissions. It does NOT add permissions checking.

__init__(permissions=None, **kwargs)
Parameters:

permissions (int | BV | None)

property perm_read
property perm_write
property perm_exec
class angr.storage.memory_mixins.paged_memory.pages.RefcountMixin

Bases: MemoryMixin

This mixin adds a locked reference counter and methods to manipulate it, to facilitate copy-on-write optimizations.

__init__(**kwargs)
acquire_unique()

Call this function to return a version of this page which can be used for writing, which may or may not be the same object as before. If you use this you must immediately replace the shared reference you previously had with the new unique copy.

acquire_shared()

Call this function to indicate that this page has had a reference added to it and must be copied before it can be acquired uniquely again. Creating the object implicitly starts it with one shared reference.

Return type:

None

release_shared()

Call this function to indicate that this page has had a shared reference to it released

Return type:

None

class angr.storage.memory_mixins.paged_memory.pages.UltraPage

Bases: MemoryObjectMixin, PageBase

Default page implementation

SUPPORTS_CONCRETE_LOAD: bool = True
__init__(memory=None, init_zero=False, **kwargs)
classmethod new_from_shared(data, memory=None, **kwargs)
load(addr, size=None, page_addr=None, endness=None, memory=None, cooperate=False, **kwargs)
store(addr, data, size=None, endness=None, memory=None, page_addr=None, cooperate=False, **kwargs)
Parameters:
changed_bytes(other, page_addr=None)
Return type:

set[int]

replace_all_with_offsets(offsets, old, new, memory=None)
Parameters:

Submodules