feat: pub exports of used crates

This commit is contained in:
əlemi 2023-04-03 03:37:18 +02:00
parent 3fe423c2de
commit d9452b3ca8
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 13 additions and 4 deletions

View file

@ -1,8 +1,17 @@
pub mod locators;
pub mod tricks; pub mod tricks;
#[cfg(feature = "rc")] #[cfg(feature = "locator")]
pub mod rc; pub mod locators;
pub use elf;
pub use proc_maps;
pub use libloading;
pub use retour;
#[cfg(feature = "monitor")] #[cfg(feature = "monitor")]
pub mod monitor; pub mod monitor;
pub use tracing_subscriber;
#[cfg(feature = "rc")]
pub mod rc;
pub use nix;

View file

@ -24,7 +24,7 @@ pub fn find_symbol<T : Function>(name: &str) -> Result<Option<T>, Box<dyn Error>
Some((base, path)) => match exec::offset_in_elf(&path, &name)? { Some((base, path)) => match exec::offset_in_elf(&path, &name)? {
None => warn!("could not locate requested symbol in ELF"), None => warn!("could not locate requested symbol in ELF"),
Some(offset) => { Some(offset) => {
let addr : *const () = (base + offset) as *const (); let addr = (base + offset) as *const ();
return Ok(Some(unsafe { Function::from_ptr(addr) } )); return Ok(Some(unsafe { Function::from_ptr(addr) } ));
} }
} }