angr.storage.memory_mixins.paged_memory.pages¶
- class angr.storage.memory_mixins.paged_memory.pages.CooperationBase
Bases:
GenericAny 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,MemoryMixinTracks the history of memory writes.
- __init__(*args, **kwargs)
- store(addr, data, size=None, **kwargs)
- parents()
- all_bytes_changed_in_history()
- Return type:
SegmentList
- class angr.storage.memory_mixins.paged_memory.pages.ISPOMixin
Bases:
MemoryMixinAn 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,PageBaseThis 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)
- class angr.storage.memory_mixins.paged_memory.pages.MVListPage
Bases:
MemoryObjectSetMixin,PageBaseMVListPage 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:
- store(addr, data, size=None, endness=None, memory=None, cooperate=False, **kwargs)
- compare(other, page_addr=None, memory=None, changed_offsets=None)
- Return type:
- Parameters:
other (MVListPage)
page_addr (int | None)
- changed_bytes(other, page_addr=None)
- Parameters:
other (MVListPage)
page_addr (int | None)
- 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,MemoryMixinThis 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=selfbe 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:
MemoryMixinThis mixin adds a permissions_bits field and properties for extracting the read/write/exec permissions. It does NOT add permissions checking.
- property perm_read
- property perm_write
- property perm_exec
- class angr.storage.memory_mixins.paged_memory.pages.RefcountMixin
Bases:
MemoryMixinThis 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:
- release_shared()
Call this function to indicate that this page has had a shared reference to it released
- Return type:
- class angr.storage.memory_mixins.paged_memory.pages.UltraPage
Bases:
MemoryObjectMixin,PageBaseDefault page implementation
- __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:
data (int | SimMemoryObject)
size (int | None)
Submodules