#shared #dylib #cross-platform #library #memory-address #dl-iterate-phdr #dyld

dev findshlibs

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

15 releases (8 breaking)

0.10.2 Nov 11, 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

#43 in Operating systems

Download history 137567/week @ 2024-01-03 135790/week @ 2024-01-10 158327/week @ 2024-01-17 156178/week @ 2024-01-24 140605/week @ 2024-01-31 146782/week @ 2024-02-07 151121/week @ 2024-02-14 162698/week @ 2024-02-21 166520/week @ 2024-02-28 164334/week @ 2024-03-06 149596/week @ 2024-03-13 162263/week @ 2024-03-20 163397/week @ 2024-03-27 165909/week @ 2024-04-03 161302/week @ 2024-04-10 132428/week @ 2024-04-17

653,097 downloads per month
Used in 154 crates (9 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

~0.4–390KB