checksec/
lib.rs

1#![warn(clippy::pedantic)]
2//! ![checksec](https://raw.githubusercontent.com/etke/checksec.rs/master/resources/checksec.svg?sanitize=true)
3//!
4//! Checksec is a standalone command line utility and library that provides
5//! binary executable security-oriented property checks for `ELF`, `PE`, and
6//! `MachO`executables.
7//!
8//! **Structures**
9//!
10//! The full checksec results can be retrieved from the implemented
11//! `*CheckSecResult` structures for a given binary by passing a
12//! [`goblin::Object`](https://docs.rs/goblin/latest/goblin/enum.Object.html)
13//! object to the parse method.
14//!
15//! * [`checksec::elf::CheckSecResults`](crate::elf::CheckSecResults)
16//! * [`checksec::macho::CheckSecResults`](crate::macho::CheckSecResults)
17//! * [`checksec::pe::CheckSecResults`](crate::pe::CheckSecResults)
18//!
19//! ```rust
20//! use checksec::elf::CheckSecResults as ElfCheckSecResults;
21//! use checksec::macho::CheckSecResults as MachOCheckSecResults;
22//! use checksec::pe::CheckSecResults as PECheckSecResults;
23//! ```
24//!
25//! **Traits**
26//!
27//! Add the associated `*Properties` trait to the imports as shown below to
28//! have direct access to the security property check functions for a given
29//! binary executable format.
30//!
31//! * [`checksec::elf::Properties`](crate::elf::Properties)
32//! * [`checksec::macho::Properties`](crate::macho::Properties)
33//! * [`checksec::pe::Properties`](crate::pe::Properties)
34//!
35//! ```rust
36//! use checksec::elf::Properties as ElfProperties;
37//! use checksec::macho::Properties as MachOProperties;
38//! use checksec::pe::Properties as PEProperties;
39//! ```
40//!
41//! Refer to the generated docs or the examples directory
42//! [examples/](https://github.com/etke/checksec.rs/tree/master/examples)
43//! for examples of working with both `*Properties` traits and
44//! `*CheckSecResults` structs.
45//!
46
47#[cfg(feature = "elf")]
48pub mod elf;
49#[cfg(feature = "macho")]
50pub mod macho;
51pub mod macros;
52#[cfg(feature = "pe")]
53pub mod pe;
54#[cfg(feature = "shared")]
55#[macro_use]
56pub mod shared;