LIEF: Library to Instrument Executable Formats Version 0.16.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_ELF_HEADER_H
17#define LIEF_ELF_HEADER_H
38 using identity_t = std::array<uint8_t, 16>;
40 public:
enum ELF_INDENT {
55 enum class FILE_TYPE {
105 enum class ELF_DATA {
127 return machine_type_;
132 return object_file_version_;
142 return program_headers_offset_;
147 return section_headers_offset_;
152 return processor_flags_;
164 return program_header_size_;
169 return numberof_segments_;
175 return section_header_size_;
183 return numberof_sections_;
188 return section_string_table_idx_;
202 return CLASS(identity_[ELI_CLASS]);
207 return ELF_DATA(identity_[ELI_DATA]);
212 return VERSION(identity_[ELI_VERSION]);
217 return OS_ABI(identity_[ELI_OSABI]);
222 return identity_[ELI_ABIVERSION];
225 bool has(PROCESSOR_FLAGS flag)
const;
234 machine_type_ = arch;
238 object_file_version_ = version;
246 program_headers_offset_ = offset;
250 section_headers_offset_ = offset;
254 processor_flags_ = flags;
262 program_header_size_ = size;
266 numberof_segments_ = n;
269 section_header_size_ = size;
273 numberof_sections_ = n;
276 section_string_table_idx_ = idx;
283 identity_[ELI_CLASS] =
static_cast<uint8_t
>(cls);
287 identity_[ELI_DATA] =
static_cast<uint8_t
>(data);
291 identity_[ELI_VERSION] =
static_cast<uint8_t
>(version);
295 identity_[ELI_OSABI] =
static_cast<uint8_t
>(osabi);
299 identity_[ELI_ABIVERSION] = version;
302 void accept(Visitor& visitor)
const override;
310 identity_t identity_;
311 FILE_TYPE file_type_ = FILE_TYPE::NONE;
312 ARCH machine_type_ = ARCH::NONE;
313 VERSION object_file_version_ = VERSION::NONE;
314 uint64_t entrypoint_ = 0;
315 uint64_t program_headers_offset_ = 0;
316 uint64_t section_headers_offset_ = 0;
317 uint32_t processor_flags_ = 0;
318 uint32_t header_size_ = 0;
319 uint32_t program_header_size_ = 0;
320 uint32_t numberof_segments_ = 0;
321 uint32_t section_header_size_ = 0;
322 uint32_t numberof_sections_ = 0;
323 uint32_t section_string_table_idx_ = 0;
Class which parses and transforms an ELF file into a ELF::Binary object.
Definition ELF/Parser.hpp:45
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
const char * to_string(DynamicEntry::TAG e)
ARCH
Definition ELF/enums.hpp:30
@ ARM
Definition ELF/enums.hpp:54
@ NONE
Definition ELF/enums.hpp:31
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42