tugger_binary_analysis/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5/*! Functionality for analyzing the content of platform binaries. */
6
7mod audit;
8pub use audit::{analyze_data, analyze_elf_libraries, analyze_file};
9mod elf;
10pub use elf::find_undefined_elf_symbols;
11mod linux_distro_versions;
12pub use linux_distro_versions::{
13    find_minimum_distro_version, GCC_VERSIONS_BY_DISTRO, GLIBC_VERSIONS_BY_DISTRO,
14};
15mod pe;
16pub use pe::{find_pe_dependencies, find_pe_dependencies_path};
17
18/// Shared libraries defined as part of the Linux Shared Base specification.
19pub const LSB_SHARED_LIBRARIES: &[&str] = &[
20    "ld-linux-x86-64.so.2",
21    "libc.so.6",
22    "libdl.so.2",
23    "libgcc_s.so.1",
24    "libm.so.6",
25    "libpthread.so.0",
26    "librt.so.1",
27    "libutil.so.1",
28];
29
30#[derive(Debug, Eq, PartialEq, PartialOrd, Ord)]
31pub struct UndefinedSymbol {
32    pub symbol: String,
33    pub filename: Option<String>,
34    pub version: Option<String>,
35}