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

findshlibs

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

14 releases (8 breaking)

new 0.10.1 Oct 22, 2021
0.9.0 Oct 2, 2021
0.8.0 Nov 25, 2020
0.7.0 May 12, 2020
0.2.0 Nov 24, 2016

#35 in Operating systems

Download history 3027/week @ 2021-07-03 3793/week @ 2021-07-10 2275/week @ 2021-07-17 3257/week @ 2021-07-24 2597/week @ 2021-07-31 2579/week @ 2021-08-07 2751/week @ 2021-08-14 4138/week @ 2021-08-21 2429/week @ 2021-08-28 4504/week @ 2021-09-04 4357/week @ 2021-09-11 6339/week @ 2021-09-18 6659/week @ 2021-09-25 5210/week @ 2021-10-02 7334/week @ 2021-10-09 3320/week @ 2021-10-16

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

MIT/Apache

61KB
1.5K SLoC

findshlibs

Build 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
  • Windows
  • Android
  • iOS

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

~200KB

W˜ra