pub struct ElfBinary<'s> {
    pub file: ElfFile<'s>,
    pub dynamic: Option<DynamicInfo>,
}
Expand description

Abstract representation of a loadable ELF binary.

Fields

file: ElfFile<'s>

The ELF file in question.

dynamic: Option<DynamicInfo>

Parsed information from the .dynamic section (if the binary has it).

Implementations

Create a new ElfBinary.

Returns true if the binary is compiled as position independent code or false otherwise.

For the binary to be PIE it needs to have a .dynamic section with PIE set in the flags1 field.

Returns the dynamic loader if present.

readelf -x .interp

For a statically compiled binary this will return None

Returns the target architecture

Return the entry point of the ELF file.

Note this may be zero in case of position independent executables.

Create a slice of the program headers.

Get the name of the sectione

Enumerate all the symbols in the file

Processing the program headers and issue commands to loader.

Will tell loader to create space in the address space / region where the header is supposed to go, then copy it there, and finally relocate it.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.