Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
arion::ContextManager Class Reference

#include <context_manager.hpp>

Public Member Functions

 ContextManager (std::weak_ptr< Arion > arion)
 
std::shared_ptr< ARION_CONTEXTsave ()
 
void restore (std::shared_ptr< ARION_CONTEXT > ctx, bool restore_mappings=true, bool restore_data=true)
 
void restore (std::shared_ptr< ARION_CONTEXT > ctx, std::vector< std::shared_ptr< ARION_MEM_EDIT > > edits)
 
void save_to_file (std::string file_path)
 
void restore_from_file (std::string file_path)
 

Static Public Member Functions

static std::unique_ptr< ContextManagerinitialize (std::weak_ptr< Arion > arion)
 

Private Attributes

std::weak_ptr< Arionarion
 The Arion instance which context is being managed.
 

Detailed Description

This class is used to operate over ARION_CONTEXT instances. It is able to save and load contexts with different restauration modes.

Constructor & Destructor Documentation

◆ ContextManager()

arion::ContextManager::ContextManager ( std::weak_ptr< Arion arion)
inline

Builder for ContextManager instances.

Parameters
[in]ArionThe Arion instance which context is being managed.

Member Function Documentation

◆ initialize()

static std::unique_ptr< ContextManager > arion::ContextManager::initialize ( std::weak_ptr< Arion arion)
static

Instanciates and initializes new ContextManager objects with some parameters.

Parameters
[in]arionThe Arion instance which context is being managed.
Returns
A new ContextManager instance.

◆ restore() [1/2]

void arion::ContextManager::restore ( std::shared_ptr< ARION_CONTEXT ctx,
bool  restore_mappings = true,
bool  restore_data = true 
)

Restores a saved ARION_CONTEXT into the associated Arion instance.

Parameters
[in]ctxThe ARION_CONTEXT to be restored.
[in]restore_mappingsTrue if memory allocations should be restored as in the saved context. This parameter does not condition restoring the memory allocations data.
[in]restore_dataTrue if the memory allocations data should be restored as in the saved context.

◆ restore() [2/2]

void arion::ContextManager::restore ( std::shared_ptr< ARION_CONTEXT ctx,
std::vector< std::shared_ptr< ARION_MEM_EDIT > >  edits 
)

Restores a saved ARION_CONTEXT into the associated Arion instance, using a history of memory edits for optimization purpose.

Parameters
[in]ctxThe ARION_CONTEXT to be restored.
[in]editsThe history of memory operations to be reversed.

◆ restore_from_file()

void arion::ContextManager::restore_from_file ( std::string  file_path)

Restores a saved context from a file into the associated Arion instance.

◆ save()

std::shared_ptr< ARION_CONTEXT > arion::ContextManager::save ( )

Saves the current context of the associated Arion instance into an ARION_CONTEXT instance.

Returns
The ARION_CONTEXT instance.

◆ save_to_file()

void arion::ContextManager::save_to_file ( std::string  file_path)

Saves the current context of the associated Arion instance into a dedicated file.

Parameters
[in]file_pathThe path of the output context file.

Member Data Documentation

◆ arion

std::weak_ptr<Arion> arion::ContextManager::arion
private

The Arion instance which context is being managed.


The documentation for this class was generated from the following file: