maat::Arch class

Base class representing an architecture.

It holds information such as the size of the registers, the number of registers, and available CPU modes for architectures that can have several modes (like ARMv7)

❱   Base classes

class Serializable
Virtual interface that serializable classes must implement.

❱   Derived classes

class ArchX64
Intel X86-64 architecture.

class ArchX86
Intel X86-32 architecture.

❱   Public types

enum class Type { X86, X64, ARM32, ARM64, NONE }
Architectures supported by Maat's engine.

❱   Constructors, destructors, conversion operators

Arch(Arch::Type type, int bits, int nb_regs)

❱   Public functions

auto reg_name(reg_t num) const -> const std::string&
Get name of register 'num'.

auto reg_num(const std::string& name) const -> reg_t
Get num of register named 'name'.

auto reg_size(reg_t reg) const -> size_t pure virtual
Get size in bits of register 'reg'.

auto sp() const -> reg_t pure virtual
Stack pointer for this architecture.

auto pc() const -> reg_t pure virtual
Program counter for this architecture.

auto tsc() const -> reg_t pure virtual
Timestamp/Clock counter for this architecture.

auto bits() const -> int
Return the size of the architecture in bits.

auto octets() const -> int
Return the size of the architecture in bytes/octets.

auto class_uid() const -> serial::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.

❱   Public variables

const Arch::Type type
Architecture identifier.

const int nb_regs
Number of registers in this architecture.

std::vector<CPUMode> available_modes
CPU modes available for the architecture.

❱   Protected variables

std::unordered_map<std::string, reg_t> reg_map
name to reg mapping

❱   Enum documentation

enum class maat::Arch::Type

Architectures supported by Maat's engine.

Enumerators
X86

Intel X86.

X64

Intel X86_64.

ARM32
ARM64
NONE

❱   Function documentation

maat::Arch::Arch(Arch::Type type, int bits, int nb_regs)

Constructor