[][src]Struct checksec::macho::MachOCheckSecResults

pub struct MachOCheckSecResults {
    pub arc: bool,
    pub canary: bool,
    pub code_signature: bool,
    pub encrypted: bool,
    pub nx_heap: bool,
    pub nx_stack: bool,
    pub pie: bool,
    pub restrict: bool,
    pub rpath: bool,
}

Checksec result struct for MachO32/64 binaries

Example

use checksec::macho::MachOCheckSecResults;
use goblin::mach::MachO;
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(macho) = MachO::parse(&buf) {
                println!("{:#?}", MachOCheckSecResults::parse(&macho));
            }
        }
    }
}

Fields

arc: bool

Automatic Reference Counting

canary: bool

Stack Canary

code_signature: bool

Code Signature (codesign)

encrypted: bool

Encrypted (LC_ENCRYPTION_INFO/LC_ENCRYPTION_INFO_64)

nx_heap: bool

Non-Executable Heap (MH_NO_HEAP_EXECUTION)

nx_stack: bool

Non-Executable Stack (MH_ALLOW_STACK_EXECUTION)

pie: bool

Position Independent Executable (MH_PIE)

restrict: bool

Restrict segment

rpath: bool

Load Command @rpath

Methods

impl MachOCheckSecResults[src]

Trait Implementations

impl Debug for MachOCheckSecResults[src]

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

impl Display for MachOCheckSecResults[src]

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

Colorized human readable format output

impl Serialize for MachOCheckSecResults[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.