[][src]Struct dlopen::raw::AddressInfoObtainer

pub struct AddressInfoObtainer {}

Obtains information about an address previously loaded from a dynamic load library.

Methods

impl AddressInfoObtainer[src]

pub fn new() -> AddressInfoObtainer[src]

pub fn obtain(&self, addr: *const ()) -> Result<AddressInfo, Error>[src]

Obtains information about an address previously loaded from a dynamic load library.

Example

extern crate dlopen;
use dlopen::raw::{Library, AddressInfoObtainer};
fn main() {
    let lib = Library::open("libyourlib.so").unwrap();
    let ptr: * const i32 = unsafe{ lib.symbol("symbolname") }.unwrap();

    // now we can obtain information about the symbol - library, base address etc.
    let aio = AddressInfoObtainer::new();
    let addr_info = aio.obtain(ptr as * const ()).unwrap();
    println!("Library path: {}", &addr_info.dll_path);
    println!("Library base address: {:?}", addr_info.dll_base_addr);
    if let Some(os) = addr_info.overlapping_symbol{
        println!("Overlapping symbol name: {}", &os.name);
        println!("Overlapping symbol address: {:?}", os.addr);
    }

}

Trait Implementations

impl Drop for AddressInfoObtainer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]