LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::EnclaveConfiguration Class Reference

This class represents the enclave configuration. More...

#include <EnclaveConfiguration.hpp>

Public Types

using id_array_t = std::array<uint8_t, 16>
 
using imports_t = std::vector<EnclaveImport>
 
using it_imports = ref_iterator<imports_t&>
 
using it_const_imports = const_ref_iterator<const imports_t&>
 

Public Member Functions

 EnclaveConfiguration ()=default
 
 EnclaveConfiguration (const EnclaveConfiguration &)=default
 
EnclaveConfigurationoperator= (const EnclaveConfiguration &)=default
 
 EnclaveConfiguration (EnclaveConfiguration &&)=default
 
EnclaveConfigurationoperator= (EnclaveConfiguration &&)=default
 
std::unique_ptr< EnclaveConfigurationclone () const
 
uint32_t size () const
 The size of the IMAGE_ENCLAVE_CONFIG64/IMAGE_ENCLAVE_CONFIG32 structure, in bytes.
 
uint32_t min_required_config_size () const
 The minimum size of the IMAGE_ENCLAVE_CONFIG(32,64) structure that the image loader must be able to process in order for the enclave to be usable.
 
uint32_t policy_flags () const
 A flag that indicates whether the enclave permits debugging.
 
bool is_debuggable () const
 Whether this enclave can be debugged.
 
uint32_t import_list_rva () const
 The RVA of the array of images that the enclave image may import, with identity information for each image.
 
uint32_t import_entry_size () const
 The size of each image in the array of images that the import_list_rva() member points to.
 
size_t nb_imports () const
 The number of images in the array of images that the import_list_rva() member points to.
 
it_imports imports ()
 Return an iterator over the enclave's imports.
 
it_const_imports imports () const
 
const id_array_tfamily_id () const
 The family identifier that the author of the enclave assigned to the enclave.
 
const id_array_timage_id () const
 The image identifier that the author of the enclave assigned to the enclave.
 
uint32_t image_version () const
 The version number that the author of the enclave assigned to the enclave.
 
uint32_t security_version () const
 The security version number that the author of the enclave assigned to the enclave.
 
uint64_t enclave_size () const
 The expected virtual size of the private address range for the enclave, in bytes.
 
uint32_t nb_threads () const
 The maximum number of threads that can be created within the enclave.
 
uint32_t enclave_flags () const
 A flag that indicates whether the image is suitable for use as the primary image in the enclave.
 
EnclaveConfigurationsize (uint32_t value)
 
EnclaveConfigurationmin_required_config_size (uint32_t value)
 
EnclaveConfigurationpolicy_flags (uint32_t value)
 
EnclaveConfigurationimport_list_rva (uint32_t value)
 
EnclaveConfigurationimport_entry_size (uint32_t value)
 
EnclaveConfigurationfamily_id (const id_array_t &value)
 
EnclaveConfigurationimage_id (const id_array_t &value)
 
EnclaveConfigurationimage_version (uint32_t value)
 
EnclaveConfigurationsecurity_version (uint32_t value)
 
EnclaveConfigurationenclave_size (uint64_t value)
 
EnclaveConfigurationnb_threads (uint32_t value)
 
EnclaveConfigurationenclave_flags (uint32_t value)
 
std::string to_string () const
 

Static Public Attributes

static constexpr auto MIN_SIZE = 0x4C
 
static constexpr auto POLICY_DEBUGGABLE = 0x00000001
 

Detailed Description

This class represents the enclave configuration.

Member Typedef Documentation

◆ id_array_t

using LIEF::PE::EnclaveConfiguration::id_array_t = std::array<uint8_t, 16>

◆ imports_t

◆ it_const_imports

◆ it_imports

Constructor & Destructor Documentation

◆ EnclaveConfiguration() [1/3]

LIEF::PE::EnclaveConfiguration::EnclaveConfiguration ( )
default

◆ EnclaveConfiguration() [2/3]

LIEF::PE::EnclaveConfiguration::EnclaveConfiguration ( const EnclaveConfiguration & )
default

◆ EnclaveConfiguration() [3/3]

LIEF::PE::EnclaveConfiguration::EnclaveConfiguration ( EnclaveConfiguration && )
default

Member Function Documentation

◆ clone()

std::unique_ptr< EnclaveConfiguration > LIEF::PE::EnclaveConfiguration::clone ( ) const
inline

◆ enclave_flags() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::enclave_flags ( ) const
inline

A flag that indicates whether the image is suitable for use as the primary image in the enclave.

◆ enclave_flags() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::enclave_flags ( uint32_t value)
inline

◆ enclave_size() [1/2]

uint64_t LIEF::PE::EnclaveConfiguration::enclave_size ( ) const
inline

The expected virtual size of the private address range for the enclave, in bytes.

◆ enclave_size() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::enclave_size ( uint64_t value)
inline

◆ family_id() [1/2]

const id_array_t & LIEF::PE::EnclaveConfiguration::family_id ( ) const
inline

The family identifier that the author of the enclave assigned to the enclave.

◆ family_id() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::family_id ( const id_array_t & value)
inline

◆ image_id() [1/2]

const id_array_t & LIEF::PE::EnclaveConfiguration::image_id ( ) const
inline

The image identifier that the author of the enclave assigned to the enclave.

◆ image_id() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::image_id ( const id_array_t & value)
inline

◆ image_version() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::image_version ( ) const
inline

The version number that the author of the enclave assigned to the enclave.

◆ image_version() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::image_version ( uint32_t value)
inline

◆ import_entry_size() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::import_entry_size ( ) const
inline

The size of each image in the array of images that the import_list_rva() member points to.

◆ import_entry_size() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::import_entry_size ( uint32_t value)
inline

◆ import_list_rva() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::import_list_rva ( ) const
inline

The RVA of the array of images that the enclave image may import, with identity information for each image.

◆ import_list_rva() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::import_list_rva ( uint32_t value)
inline

◆ imports() [1/2]

it_imports LIEF::PE::EnclaveConfiguration::imports ( )
inline

Return an iterator over the enclave's imports.

◆ imports() [2/2]

it_const_imports LIEF::PE::EnclaveConfiguration::imports ( ) const
inline

◆ is_debuggable()

bool LIEF::PE::EnclaveConfiguration::is_debuggable ( ) const
inline

Whether this enclave can be debugged.

◆ min_required_config_size() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::min_required_config_size ( ) const
inline

The minimum size of the IMAGE_ENCLAVE_CONFIG(32,64) structure that the image loader must be able to process in order for the enclave to be usable.

This member allows an enclave to inform an earlier version of the image loader that the image loader can safely load the enclave and ignore optional members added to IMAGE_ENCLAVE_CONFIG(32,64) for later versions of the enclave. If the size of IMAGE_ENCLAVE_CONFIG(32,64) that the image loader can process is less than MinimumRequiredConfigSize, the enclave cannot be run securely.

If MinimumRequiredConfigSize is zero, the minimum size of the IMAGE_ENCLAVE_CONFIG(32,64) structure that the image loader must be able to process in order for the enclave to be usable is assumed to be the size of the structure through and including the MinimumRequiredConfigSize member.

◆ min_required_config_size() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::min_required_config_size ( uint32_t value)
inline

◆ nb_imports()

size_t LIEF::PE::EnclaveConfiguration::nb_imports ( ) const
inline

The number of images in the array of images that the import_list_rva() member points to.

◆ nb_threads() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::nb_threads ( ) const
inline

The maximum number of threads that can be created within the enclave.

◆ nb_threads() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::nb_threads ( uint32_t value)
inline

◆ operator=() [1/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::operator= ( const EnclaveConfiguration & )
default

◆ operator=() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::operator= ( EnclaveConfiguration && )
default

◆ policy_flags() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::policy_flags ( ) const
inline

A flag that indicates whether the enclave permits debugging.

◆ policy_flags() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::policy_flags ( uint32_t value)
inline

◆ security_version() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::security_version ( ) const
inline

The security version number that the author of the enclave assigned to the enclave.

◆ security_version() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::security_version ( uint32_t value)
inline

◆ size() [1/2]

uint32_t LIEF::PE::EnclaveConfiguration::size ( ) const
inline

The size of the IMAGE_ENCLAVE_CONFIG64/IMAGE_ENCLAVE_CONFIG32 structure, in bytes.

◆ size() [2/2]

EnclaveConfiguration & LIEF::PE::EnclaveConfiguration::size ( uint32_t value)
inline

◆ to_string()

std::string LIEF::PE::EnclaveConfiguration::to_string ( ) const

Referenced by operator<<.

Member Data Documentation

◆ MIN_SIZE

auto LIEF::PE::EnclaveConfiguration::MIN_SIZE = 0x4C
staticconstexpr

◆ POLICY_DEBUGGABLE

auto LIEF::PE::EnclaveConfiguration::POLICY_DEBUGGABLE = 0x00000001
staticconstexpr

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