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
header: Header
The ELF header, which provides a rudimentary index into the rest of the binary
program_headers: ProgramHeaders
The program headers; they primarily tell the kernel and the dynamic linker how to load this binary
section_headers: SectionHeaders
The sections headers. These are strippable, never count on them being here unless you're a static linker!
shdr_strtab: Strtab<'static>
The section header string table
dynstrtab: Strtab<'static>
The string table for the dynamically accessible symbols
dynsyms: Syms
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
syms: Syms
The debugging symbol array
strtab: Strtab<'static>
The string table for the symbol array
dynamic: Option<Dynamic>
Contains dynamic linking information, with the _DYNAMIC array + a preprocessed DynamicInfo for that array
dynrelas: Vec<Reloc>
The dynamic relocation entries (strings, copy-data, etc.) with an addend
dynrels: Vec<Reloc>
The dynamic relocation entries without an addend
pltrelocs: Vec<Reloc>
The plt relocation entries (procedure linkage table). For 32-bit binaries these are usually Rel (no addend)
shdr_relocs: Vec<(ShdrIdx, Vec<Reloc>)>
Section relocations by section index (only present if this is a relocatable object file)
soname: Option<String>
The binary's soname, if it has one
interpreter: Option<String>
The binary's program interpreter (e.g., dynamic linker), if it has one
libraries: Vec<String>
A list of this binary's dynamic libraries it uses, if there are any
is_64: bool
is_lib: bool
Whether this is a shared object or not
entry: u64
The binaries entry point address, if it has one
bias: u64
The bias used to overflow virtual memory addresses into physical byte offsets into the binary
little_endian: bool
Whether the binary is little endian or not
Methods
impl Elf
[src]
fn parse<S: AsRef<[u8]>>(buffer: &S) -> Result<Self>
Parses the contents of the byte stream in buffer
, and maybe returns a unified binary
fn try_from<R: Read>(fd: &mut R) -> Result<Self>
Returns a unified ELF binary from fd
. Allocates an in-memory byte array the size of the binary in order to increase performance.