angr.storage.memory_mixins.memory_mixin¶
- class angr.storage.memory_mixins.memory_mixin.SupportsMemoryMerge¶
Bases:
SupportsMerge,ProtocolThe merge contract of memory models:
SupportsMergeplus theis_wideningflag thatwidenpasses.
- class angr.storage.memory_mixins.memory_mixin.SupportsSubsumes¶
Bases:
ProtocolThe subsumes contract of memory models that support it. A Protocol so that
Selfbinds to the implementing class.- __init__(*args, **kwargs)
- class angr.storage.memory_mixins.memory_mixin.MemoryMixin¶
Bases:
SimStatePlugin,SupportsMemoryMerge,Generic[InData,OutData,Addr]MemoryMixin is the base class for the memory model in angr. It provides a set of methods that should be implemented by memory models. This is done using mixins, where each mixin handles some specific feature of the memory model, only overriding methods that it needs to implement its function. The memory model class itself then combines a set of mixins using inheritence to form the final memory model class.
- property category: str¶
reg, mem, or file.
- Type:
Return the category of this SimMemory instance. It can be one of the three following categories
- find(addr, data, max_search, **kwargs)¶
- load(addr, size=None, **kwargs)¶
- Return type:
OutData- Parameters:
addr (Addr)
size (InData | None)
- store(addr, data, size=None, **kwargs)¶
- Return type:
- Parameters:
addr (Addr)
data (InData)
size (InData | None)
- MERGE_WHOLE_OBJECTS = False¶
- permissions(addr, permissions=None, **kwargs)¶
- Return type:
BV- Parameters:
addr (Addr)
permissions (int | claripy.ast.BV | None)
- map_region(addr, length, permissions, *, init_zero=False, **kwargs)¶
- concrete_load(addr, size, writing=False, **kwargs)¶
Set SUPPORTS_CONCRETE_LOAD to True and implement concrete_load if reading concrete bytes is faster in this memory model.
- Parameters:
addr – The address to load from.
size – Size of the memory read.
writing
- Return type:
- Returns:
A memoryview into the loaded bytes.
- concrete_run_length(addr, size, **kwargs)¶
Return the number of concrete bytes starting at
addr, capped atsize.- Return type:
- erase(addr, size=None, **kwargs)¶
Set [addr:addr+size) to uninitialized. In many cases this will be faster than overwriting those locations with new values. This is commonly used during static data flow analysis.
- replace_all(old, new)¶
- Parameters:
old (BV)
new (BV)
- copy_contents(dst, src, size, condition=None, **kwargs)¶
Override this method to provide faster copying of large chunks of data.
- Parameters:
dst (
Addr) – The destination of copying.src (
Addr) – The source of copying.size (
InData) – The size of copying.condition (
Bool|None) – The storing condition.kwargs – Other parameters.
- Returns:
None