#shared #cross-platform #dylib #process-memory #library #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

#59 in Operating systems

Download history 168777/week @ 2024-07-23 154000/week @ 2024-07-30 168352/week @ 2024-08-06 171367/week @ 2024-08-13 166725/week @ 2024-08-20 168287/week @ 2024-08-27 183503/week @ 2024-09-03 186585/week @ 2024-09-10 171810/week @ 2024-09-17 186506/week @ 2024-09-24 191888/week @ 2024-10-01 190345/week @ 2024-10-08 214308/week @ 2024-10-15 215678/week @ 2024-10-22 206308/week @ 2024-10-29 200428/week @ 2024-11-05

868,838 downloads per month
Used in 198 crates (10 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–500KB