ELF

Elf_Binary_t *elf_parse(const char *file)

Wrapper for LIEF::ELF::Parser::parse.

void elf_binary_destroy(Elf_Binary_t *binary)
int elf_binary_save_header(Elf_Binary_t *binary)

Update LIEF::ELF::Header object.

Elf_Binary_t

struct Elf_Binary_t

LIEF::ELF::Binary C Handler.

Public Members

void *handler
const char *name
const char *interpreter
LIEF_ELF_ELF_CLASS type
Elf_Header_t header
Elf_Section_t **sections
Elf_Segment_t **segments
Elf_DynamicEntry_t **dynamic_entries
Elf_Symbol_t **dynamic_symbols
Elf_Symbol_t **static_symbols

Elf_Header_t

struct Elf_Header_t

Public Members

uint8_t identity[LIEF_ELF_EI_NIDENT]
LIEF_ELF_E_TYPE file_type
LIEF_ELF_ARCH machine_type
LIEF_ELF_VERSION object_file_version
uint64_t entrypoint
uint64_t program_headers_offset
uint64_t section_headers_offset
uint32_t processor_flags
uint32_t header_size
uint32_t program_header_size
uint32_t numberof_segments
uint32_t section_header_size
uint32_t numberof_sections
uint32_t name_string_table_idx

Elf_Section_t

struct Elf_Section_t

Public Members

const char *name
uint32_t flags
LIEF_ELF_ELF_SECTION_TYPES type
uint64_t virtual_address
uint64_t offset
uint64_t original_size
uint32_t link
uint32_t info
uint64_t alignment
uint64_t entry_size
uint64_t size
uint8_t *content
double entropy

Elf_Segment_t

struct Elf_Segment_t

Public Members

LIEF_ELF_SEGMENT_TYPES type
uint32_t flags
uint64_t virtual_address
uint64_t virtual_size
uint64_t offset
uint64_t alignment
uint64_t size
uint8_t *content

Dynamic Entries

Elf_DynamicEntry_t

struct Elf_DynamicEntry_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value

Elf_DynamicEntry_Library_t

struct Elf_DynamicEntry_Library_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
const char *name

Elf_DynamicEntry_SharedObject_t

struct Elf_DynamicEntry_SharedObject_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
const char *name

Elf_DynamicEntry_Array_t

struct Elf_DynamicEntry_Array_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
uint64_t *array

Elf_DynamicEntry_Rpath_t

struct Elf_DynamicEntry_Rpath_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
const char *rpath

Elf_DynamicEntry_RunPath_t

struct Elf_DynamicEntry_RunPath_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
const char *runpath

Elf_DynamicEntry_Flags_t

struct Elf_DynamicEntry_Flags_t

Public Members

LIEF_ELF_DYNAMIC_TAGS tag
uint64_t value
LIEF_ELF_DYNAMIC_FLAGS *flags
LIEF_ELF_DYNAMIC_FLAGS_1 *flags_1

Utilities

group elf_utils_c_api

Utils C API.

Functions

bool is_elf(const char *file)

Check if the given file is an ELF one.