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

Defines an entry in the array of images that an enclave can import. More...

#include <EnclaveImport.hpp>

Public Types

enum class  TYPE : uint32_t {
  NONE = 0x00000000 , UNIQUE_ID = 0x00000001 , AUTHOR_ID = 0x00000002 , FAMILY_ID = 0x00000003 ,
  IMAGE_ID = 0x00000004
}
 
using short_id_t = std::array<uint8_t, 16>
 
using long_id_t = std::array<uint8_t, 32>
 

Public Member Functions

 EnclaveImport ()=default
 
 EnclaveImport (const EnclaveImport &)=default
 
EnclaveImportoperator= (const EnclaveImport &)=default
 
 EnclaveImport (EnclaveImport &&)=default
 
EnclaveImportoperator= (EnclaveImport &&)=default
 
TYPE type () const
 The type of identifier of the image that must match the value in the import record.
 
uint32_t min_security_version () const
 The minimum enclave security version that each image must have for the image to be imported successfully. The image is rejected unless its enclave security version is equal to or greater than the minimum value in the import record. Set the value in the import record to zero to turn off the security version check.
 
const long_id_tid () const
 The unique identifier of the primary module for the enclave, if the type() is TYPE::UNIQUE_ID. Otherwise, the author identifier of the primary module for the enclave.
 
const short_id_tfamily_id () const
 The family identifier of the primary module for the enclave.
 
const short_id_timage_id () const
 The image identifier of the primary module for the enclave.
 
uint32_t import_name_rva () const
 The relative virtual address of a NULL-terminated string that contains the same value found in the import directory for the image.
 
const std::string & import_name () const
 Resolved import name.
 
uint32_t reserved () const
 Reserved. Should be 0.
 
EnclaveImporttype (TYPE ty)
 
EnclaveImportmin_security_version (uint32_t value)
 
EnclaveImportid (const long_id_t &value)
 
EnclaveImportfamily_id (const short_id_t &value)
 
EnclaveImportimage_id (const short_id_t &value)
 
EnclaveImportimport_name_rva (uint32_t value)
 
EnclaveImportreserved (uint32_t value)
 
EnclaveImportimport_name (std::string name)
 
std::string to_string () const
 

Detailed Description

Defines an entry in the array of images that an enclave can import.

Member Typedef Documentation

◆ long_id_t

using LIEF::PE::EnclaveImport::long_id_t = std::array<uint8_t, 32>

◆ short_id_t

using LIEF::PE::EnclaveImport::short_id_t = std::array<uint8_t, 16>

Member Enumeration Documentation

◆ TYPE

enum class LIEF::PE::EnclaveImport::TYPE : uint32_t
strong
Enumerator
NONE 

None of the identifiers of the image need to match the value in the import record.

UNIQUE_ID 

The value of the enclave unique identifier of the image must match the value in the import record. Otherwise, loading of the image fails.

AUTHOR_ID 

The value of the enclave author identifier of the image must match the value in the import record. Otherwise, loading of the image fails. If this flag is set and the import record indicates an author identifier of all zeros, the imported image must be part of the Windows installation.

FAMILY_ID 

The value of the enclave family identifier of the image must match the value in the import record. Otherwise, loading of the image fails.

IMAGE_ID 

The value of the enclave image identifier of the image must match the value in the import record. Otherwise, loading of the image fails.

Constructor & Destructor Documentation

◆ EnclaveImport() [1/3]

LIEF::PE::EnclaveImport::EnclaveImport ( )
default

◆ EnclaveImport() [2/3]

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

◆ EnclaveImport() [3/3]

LIEF::PE::EnclaveImport::EnclaveImport ( EnclaveImport && )
default

Member Function Documentation

◆ family_id() [1/2]

const short_id_t & LIEF::PE::EnclaveImport::family_id ( ) const
inline

The family identifier of the primary module for the enclave.

◆ family_id() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::family_id ( const short_id_t & value)
inline

◆ id() [1/2]

const long_id_t & LIEF::PE::EnclaveImport::id ( ) const
inline

The unique identifier of the primary module for the enclave, if the type() is TYPE::UNIQUE_ID. Otherwise, the author identifier of the primary module for the enclave.

◆ id() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::id ( const long_id_t & value)
inline

◆ image_id() [1/2]

const short_id_t & LIEF::PE::EnclaveImport::image_id ( ) const
inline

The image identifier of the primary module for the enclave.

◆ image_id() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::image_id ( const short_id_t & value)
inline

◆ import_name() [1/2]

const std::string & LIEF::PE::EnclaveImport::import_name ( ) const
inline

Resolved import name.

◆ import_name() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::import_name ( std::string name)
inline

◆ import_name_rva() [1/2]

uint32_t LIEF::PE::EnclaveImport::import_name_rva ( ) const
inline

The relative virtual address of a NULL-terminated string that contains the same value found in the import directory for the image.

◆ import_name_rva() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::import_name_rva ( uint32_t value)
inline

◆ min_security_version() [1/2]

uint32_t LIEF::PE::EnclaveImport::min_security_version ( ) const
inline

The minimum enclave security version that each image must have for the image to be imported successfully. The image is rejected unless its enclave security version is equal to or greater than the minimum value in the import record. Set the value in the import record to zero to turn off the security version check.

◆ min_security_version() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::min_security_version ( uint32_t value)
inline

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ reserved() [1/2]

uint32_t LIEF::PE::EnclaveImport::reserved ( ) const
inline

Reserved. Should be 0.

◆ reserved() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::reserved ( uint32_t value)
inline

◆ to_string()

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

Referenced by operator<<.

◆ type() [1/2]

TYPE LIEF::PE::EnclaveImport::type ( ) const
inline

The type of identifier of the image that must match the value in the import record.

◆ type() [2/2]

EnclaveImport & LIEF::PE::EnclaveImport::type ( TYPE ty)
inline

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