LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_PE_LOAD_CONFIGURATION_ENCLAVE_CONFIG_H
17#define LIEF_PE_LOAD_CONFIGURATION_ENCLAVE_CONFIG_H
34 static constexpr auto MIN_SIZE = 0x4C;
36 static constexpr auto POLICY_DEBUGGABLE = 0x00000001;
38 using id_array_t = std::array<uint8_t, 16>;
40 using imports_t = std::vector<EnclaveImport>;
41 using it_imports = ref_iterator<imports_t&>;
42 using it_const_imports = const_ref_iterator<const imports_t&>;
46 EnclaveConfiguration&
operator=(
const EnclaveConfiguration&) =
default;
49 EnclaveConfiguration&
operator=(EnclaveConfiguration&&) =
default;
51 std::unique_ptr<EnclaveConfiguration>
clone()
const {
52 return std::unique_ptr<EnclaveConfiguration>(
new EnclaveConfiguration(*
this));
54 uint32_t
size()
const {
86 return (policy_flags_ & POLICY_DEBUGGABLE) != 0;
92 return imports_list_rva_;
98 return import_entry_size_;
104 return imports_.size();
121 const id_array_t&
image_id()
const {
129 return image_version_;
135 return security_version_;
141 return enclave_size_;
152 return enclave_flags_;
155 EnclaveConfiguration&
size(uint32_t value) {
161 min_req_size_ = value;
166 policy_flags_ = value;
171 imports_list_rva_ = value;
176 import_entry_size_ = value;
180 EnclaveConfiguration&
family_id(
const id_array_t& value) {
185 EnclaveConfiguration&
image_id(
const id_array_t& value) {
191 image_version_ = value;
196 security_version_ = value;
201 enclave_size_ = value;
211 enclave_flags_ = value;
218 std::ostream&
operator<<(std::ostream& os,
const EnclaveConfiguration& meta)
226 LIEF_LOCAL static std::unique_ptr<EnclaveConfiguration>
227 parse(Parser& ctx, BinaryStream& stream);
231 uint32_t min_req_size_ = 0;
232 uint32_t policy_flags_ = 0;
233 uint32_t imports_list_rva_ = 0;
234 uint32_t import_entry_size_ = 0;
235 id_array_t family_id_ = {0};
236 id_array_t image_id_ = {0};
237 uint32_t image_version_ = 0;
238 uint32_t security_version_ = 0;
239 uint64_t enclave_size_ = 0;
240 uint32_t nb_threads_ = 0;
241 uint32_t enclave_flags_ = 0;
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
This class represents the enclave configuration.
Definition EnclaveConfiguration.hpp:32
friend std::ostream & operator<<(std::ostream &os, const EnclaveConfiguration &meta)
Definition EnclaveConfiguration.hpp:218
std::unique_ptr< EnclaveConfiguration > clone() const
Definition EnclaveConfiguration.hpp:51
uint32_t size() const
The size of the IMAGE_ENCLAVE_CONFIG64/IMAGE_ENCLAVE_CONFIG32 structure, in bytes.
Definition EnclaveConfiguration.hpp:57
size_t nb_imports() const
The number of images in the array of images that the import_list_rva() member points to.
Definition EnclaveConfiguration.hpp:103
EnclaveConfiguration & enclave_flags(uint32_t value)
Definition EnclaveConfiguration.hpp:210
uint64_t enclave_size() const
The expected virtual size of the private address range for the enclave, in bytes.
Definition EnclaveConfiguration.hpp:140
EnclaveConfiguration & operator=(EnclaveConfiguration &&)=default
EnclaveConfiguration()=default
EnclaveConfiguration & min_required_config_size(uint32_t value)
Definition EnclaveConfiguration.hpp:160
uint32_t import_list_rva() const
The RVA of the array of images that the enclave image may import, with identity information for each ...
Definition EnclaveConfiguration.hpp:91
EnclaveConfiguration & image_version(uint32_t value)
Definition EnclaveConfiguration.hpp:190
EnclaveConfiguration & enclave_size(uint64_t value)
Definition EnclaveConfiguration.hpp:200
uint32_t import_entry_size() const
The size of each image in the array of images that the import_list_rva() member points to.
Definition EnclaveConfiguration.hpp:97
EnclaveConfiguration(const EnclaveConfiguration &)=default
it_const_imports imports() const
Definition EnclaveConfiguration.hpp:112
EnclaveConfiguration & policy_flags(uint32_t value)
Definition EnclaveConfiguration.hpp:165
uint32_t image_version() const
The version number that the author of the enclave assigned to the enclave.
Definition EnclaveConfiguration.hpp:128
EnclaveConfiguration & image_id(const id_array_t &value)
Definition EnclaveConfiguration.hpp:185
uint32_t nb_threads() const
The maximum number of threads that can be created within the enclave.
Definition EnclaveConfiguration.hpp:145
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 p...
Definition EnclaveConfiguration.hpp:75
EnclaveConfiguration & size(uint32_t value)
Definition EnclaveConfiguration.hpp:155
uint32_t policy_flags() const
A flag that indicates whether the enclave permits debugging.
Definition EnclaveConfiguration.hpp:80
EnclaveConfiguration & import_entry_size(uint32_t value)
Definition EnclaveConfiguration.hpp:175
uint32_t enclave_flags() const
A flag that indicates whether the image is suitable for use as the primary image in the enclave.
Definition EnclaveConfiguration.hpp:151
uint32_t security_version() const
The security version number that the author of the enclave assigned to the enclave.
Definition EnclaveConfiguration.hpp:134
const id_array_t & image_id() const
The image identifier that the author of the enclave assigned to the enclave.
Definition EnclaveConfiguration.hpp:123
std::string to_string() const
EnclaveConfiguration & security_version(uint32_t value)
Definition EnclaveConfiguration.hpp:195
bool is_debuggable() const
Whether this enclave can be debugged.
Definition EnclaveConfiguration.hpp:85
it_imports imports()
Return an iterator over the enclave's imports.
Definition EnclaveConfiguration.hpp:108
EnclaveConfiguration(EnclaveConfiguration &&)=default
EnclaveConfiguration & nb_threads(uint32_t value)
Definition EnclaveConfiguration.hpp:205
const id_array_t & family_id() const
The family identifier that the author of the enclave assigned to the enclave.
Definition EnclaveConfiguration.hpp:118
EnclaveConfiguration & family_id(const id_array_t &value)
Definition EnclaveConfiguration.hpp:180
EnclaveConfiguration & operator=(const EnclaveConfiguration &)=default
EnclaveConfiguration & import_list_rva(uint32_t value)
Definition EnclaveConfiguration.hpp:170
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:52
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42