#dylib #shared #library #dyld #dl-iterate-phdr

findshlibs

Find the set of shared libraries loaded in the current process with a cross platform API

11 releases (6 breaking)

0.8.0 Nov 25, 2020
0.7.0 May 12, 2020
0.5.0 Jun 3, 2019
0.4.1 Feb 12, 2019
0.1.0 Nov 24, 2016

#37 in Operating systems

Download history 2150/week @ 2021-02-26 1682/week @ 2021-03-05 1866/week @ 2021-03-12 1914/week @ 2021-03-19 1623/week @ 2021-03-26 1364/week @ 2021-04-02 1792/week @ 2021-04-09 1502/week @ 2021-04-16 1806/week @ 2021-04-23 2056/week @ 2021-04-30 3663/week @ 2021-05-07 2866/week @ 2021-05-14 2247/week @ 2021-05-21 1406/week @ 2021-05-28 1943/week @ 2021-06-04 1236/week @ 2021-06-11

8,654 downloads per month
Used in 8 crates (6 directly)

MIT/Apache

45KB
1K SLoC

findshlibs

Build Status Coverage Status

Find the shared libraries loaded in the current process with a cross platform API.

Documentation

📚 Documentation on docs.rs 📚

Example

Here is an example program that prints out each shared library that is loaded in the process and the addresses where each of its segments are mapped into memory.

extern crate findshlibs;
use findshlibs::{Segment, SharedLibrary, TargetSharedLibrary};

fn main() {
    TargetSharedLibrary::each(|shlib| {
        println!("{}", shlib.name().to_string_lossy());

        for seg in shlib.segments() {
            println!("    {}: segment {}",
                     seg.actual_virtual_memory_address(shlib),
                     seg.name().to_string_lossy());
        }
    });
}

Supported OSes

These are the OSes that findshlibs currently supports:

  • Linux
  • macOS

If a platform is not supported then a fallback implementation is used that does nothing. To see if your platform does something at runtime the TARGET_SUPPORTED constant can be used.

Is your OS missing here? Send us a pull request!

Dependencies