Struct DynamicLibrary

Source
pub struct DynamicLibrary<'a> { /* private fields */ }
Expand description

Dynamic Library Entry An ‘upgraded’ LibraryEntry with the dynamic section resolved.

Implementations§

Source§

impl<'a> DynamicLibrary<'a>

Source

pub fn initialize(lib: LoadedLibrary<'a>) -> Result<Self, DynamicError>

Try to consume a LoadedLibrary and create a resolved Dynamic view The Dynamic Library will take ownership of the load library as well as store all relevant dynamic sections for easy access and symbol resolution

Source

pub fn try_find_function(&self, symbol_name: &str) -> Option<&DynRela>

Finding target function differs on 32 bit and 64 bit. On 64 bit we want to check the addended relocations table only, opposed to the addendless relocations table. Additionally, we will fall back to the plt given it is an addended relocation table.

Source

pub fn plt_rel(&self) -> Option<&DynamicRelocations<'_>>

Access the plt as a dynamic relocation table if possible can fail if the plt is not available or the plt is with addend

Source

pub fn plt_rela(&self) -> Option<&DynamicAddendRelocations<'_>>

Access the plt as a dynamic addend relocation table if possible can fail if the plt is not available or the plt is without addend

Source

pub fn plt(&self) -> Option<&RelocationTable<'_>>

Access the dynamic libraries plt if available Can be either a DynamicRelocations or DynamicAddendRelocations

Source

pub fn relocs(&self) -> Option<&DynamicRelocations<'_>>

Access the dynamic libraries relocations if available

Source

pub fn addend_relocs(&self) -> Option<&DynamicAddendRelocations<'_>>

Access the dynamic libraries addend relocations if available

Source

pub fn symbols(&self) -> Option<&DynamicSymbols<'_>>

Access the dynamic libraries symbol table if available

Source

pub fn dyn_section(&self) -> &DynamicSection<'_>

Access the dynamic libraries dynamic section

Source

pub fn library(&self) -> &LoadedLibrary<'_>

Access the dynamic libraries backing general loaded library structure capable of providing the name and base address of the in memory

Source

pub fn string_table(&self) -> &StringTable<'_>

Access the dynamic string table

Auto Trait Implementations§

§

impl<'a> Freeze for DynamicLibrary<'a>

§

impl<'a> RefUnwindSafe for DynamicLibrary<'a>

§

impl<'a> Send for DynamicLibrary<'a>

§

impl<'a> Sync for DynamicLibrary<'a>

§

impl<'a> Unpin for DynamicLibrary<'a>

§

impl<'a> UnwindSafe for DynamicLibrary<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.