maat::MemAbstractBuffer class

This class represents a memory area where abstract expressions are stored. It enables to read/write any expression of size 8, 16, 32, or 64 bits.

For performance reasons, no checks are performed on the read/write operations to make sure that they don't overflow the bounds of the buffer. It is up to the caller to verify that the arguments passed are consistent.

Abstract expressions are stored in a hashmap <offset : (expr, byte_num)>.

  • offset: is the offset in the buffer (the address)
  • expr: expr is the expression written at address addr
  • byte_num: is the number of the particular octet of 'expr' that is at address addr For example, assuming little endian, writing v1 = exprvar(32, "var1") at offset 0x100 gives:
    • <0x100: (v1, 0)>
    • <0x101: (v1, 1)>
    • <0x102: (v1, 2)>
    • <0x103: (v1, 3)>

For read operations, if the value read overlaps between two different expressions stored in memory, the class automatically concatenates/extracts the corresponding parts

❱   Base classes

class Serializable
Virtual interface that serializable classes must implement.

❱   Constructors, destructors, conversion operators


❱   Public functions

auto read(offset_t off, unsigned int nb_bytes) -> Expr
Read 'nb_bytes' bytes as an abstract value from offset 'off'.

void write(offset_t off, Expr val)
Write an abstract value at offset 'off'.

auto at(offset_t off) -> std::pair<Expr, uint8_t>&
Return the abstract value pair stored at offset 'off'.

void set(offset_t off, std::pair<Expr, uint8_t>& pair)
Set the abstract value pair at offset 'off'.

auto class_uid() const -> uid_t virtual
Return the class uid (see ClassId enum)

void dump(serial::Serializer&) const virtual
Dump the object contents in a serializer stream.

void load(serial::Deserializer&) virtual
Restore an object from a deserializer stream.