maat::env::EnvEmulator class

Main class emulating a process environment.

This class provides an interface to other components that can be used to emulate system calls, IPC, a filesystem, external libraries, memory allocation on the heap, etc.

❱   Base classes

class maat::serial::Serializable
Virtual interface that serializable classes must implement.

❱   Derived classes

class LinuxEmulator
Specialisation of 'EnvEmulator' for the Linux operating system.

❱   Constructors, destructors, conversion operators

EnvEmulator(Arch::Type arch = Arch::Type::NONE, OS os = OS::NONE)
Create an emulator for architecture arch and system system

❱   Public functions

auto contains_library(const std::string& name) const -> bool
Return true if the environment can emulate the library name

auto get_library_by_name(const std::string& name) const -> const Library&
Return the emulated library named name

auto libraries() const -> const std::vector<Library>&
Return a list of all emulated libraries.

auto take_snapshot() -> snapshot_t virtual
Take a snapshot of the environment.

void restore_snapshot(snapshot_t snapshot, bool remove = false) virtual
Restore a snapshot of the environment.

void add_running_process(const ProcessInfo& pinfo, const std::string& filepath) virtual
Add a running process to the environment.

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

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

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

❱   Public variables

abi::ABI* default_abi
Default ABI for calling functions.

abi::ABI* syscall_abi
Default ABI for system calls.

❱   Protected functions

void _init(Arch::Type arch, OS os)

❱   Function documentation

void maat::env::EnvEmulator::_init(Arch::Type arch, OS os) protected

In-place initialisation function. This function is redundent with the constructor, however it is necessary to have it so that it can be called from derived classes when they are deserialized and need to be initialized after the object was allocated