Struct goblin::elf::Elf [] [src]

pub struct Elf {
    pub header: Header,
    pub program_headers: ProgramHeaders,
    pub section_headers: SectionHeaders,
    pub shdr_strtab: Strtab<'static>,
    pub dynstrtab: Strtab<'static>,
    pub dynsyms: Syms,
    pub syms: Syms,
    pub strtab: Strtab<'static>,
    pub dynamic: Option<Dynamic>,
    pub dynrelas: Vec<Reloc>,
    pub dynrels: Vec<Reloc>,
    pub pltrelocs: Vec<Reloc>,
    pub shdr_relocs: Vec<(ShdrIdx, Vec<Reloc>)>,
    pub soname: Option<String>,
    pub interpreter: Option<String>,
    pub libraries: Vec<String>,
    pub is_64: bool,
    pub is_lib: bool,
    pub entry: u64,
    pub bias: u64,
    pub little_endian: bool,
}

An ELF binary. The underlying data structures are read according to the headers byte order and container size (32 or 64).

Fields

The ELF header, which provides a rudimentary index into the rest of the binary

The program headers; they primarily tell the kernel and the dynamic linker how to load this binary

The sections headers. These are strippable, never count on them being here unless you're a static linker!

The section header string table

The string table for the dynamically accessible symbols

The dynamically accessible symbols, i.e., exports, imports. This is what the dynamic linker uses to dynamically load and link your binary, or find imported symbols for binaries which dynamically link against your library

The debugging symbol array

The string table for the symbol array

Contains dynamic linking information, with the _DYNAMIC array + a preprocessed DynamicInfo for that array

The dynamic relocation entries (strings, copy-data, etc.) with an addend

The dynamic relocation entries without an addend

The plt relocation entries (procedure linkage table). For 32-bit binaries these are usually Rel (no addend)

Section relocations by section index (only present if this is a relocatable object file)

The binary's soname, if it has one

The binary's program interpreter (e.g., dynamic linker), if it has one

A list of this binary's dynamic libraries it uses, if there are any

Whether this is a shared object or not

The binaries entry point address, if it has one

The bias used to overflow virtual memory addresses into physical byte offsets into the binary

Whether the binary is little endian or not

Methods

impl Elf
[src]

Parses the contents of the byte stream in buffer, and maybe returns a unified binary

Returns a unified ELF binary from fd. Allocates an in-memory byte array the size of the binary in order to increase performance.

Trait Implementations

impl Debug for Elf
[src]

Formats the value using the given formatter.

impl<'a> TryFromCtx<'a> for Elf
[src]