[][src]Struct checksec::elf::ElfCheckSecResults

pub struct ElfCheckSecResults {
    pub canary: bool,
    pub clang_cfi: bool,
    pub clang_safestack: bool,
    pub fortify: bool,
    pub fortified: u32,
    pub nx: bool,
    pub pie: PIE,
    pub relro: Relro,
    pub rpath: VecRpath,
    pub runpath: VecRpath,
}

Checksec result struct for ELF32/64 binaries

Example

use checksec::elf::ElfCheckSecResults;
use goblin::elf::Elf;
use std::fs;

pub fn print_results(binary: &String) {
    if let Ok(fp) = fs::File::open(&binary) {
        if let Ok(buf) = fs::read(fp) {
            if let Ok(elf) = Elf::parse(&buf) {
                println!("{:#?}", ElfCheckSecResults::parse(&elf));
            }
        }
    }
}

Fields

canary: bool

Stack Canary (CFLAGS=-fstack-protector*)

clang_cfi: bool

Clang Control Flow Integrity (CFLAGS=-fsanitize=cfi-*)

clang_safestack: bool

Clang SafeStack (CFLAGS=-fsanitize=safe-stack)

fortify: bool

Fortify (CFLAGS=-D_FORTIFY_SOURCE)

fortified: u32

Fortified functions

nx: bool

No Execute

pie: PIE

Position Inpendent Executable (CFLAGS=-pie -fPIE)

relro: Relro

Relocation Read-Only

rpath: VecRpath

Run-time search path (DT_RPATH)

runpath: VecRpath

Run-time search path (DT_RUNTIME)

Methods

impl ElfCheckSecResults[src]

Trait Implementations

impl Debug for ElfCheckSecResults[src]

impl<'de> Deserialize<'de> for ElfCheckSecResults[src]

impl Display for ElfCheckSecResults[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Colorized human readable format output

impl Serialize for ElfCheckSecResults[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.