Skip to main content

RegionView

Struct RegionView 

Source
pub struct RegionView {
    pub endian: Endianness,
    pub base: u64,
    pub entry: u64,
    pub regions: Vec<Section>,
    pub named_exec: Vec<Section>,
    pub universal: bool,
    /* private fields */
}
Expand description

Format-agnostic scan view over a loaded image.

For single-image binaries regions is exactly the image’s exec_scan_regions() (ROPgadget parity path). For Universal binaries ROPgadget UNIVERSAL semantics apply (loaders/universal.py:77-108): the exec regions of every slice concatenated into one scan, using the FIRST slice’s arch/mode/endianness — getArch/getArchMode/getEndian “just return whatever is in the first binary”.

named_exec holds the named executable sections (exec_sections()) used by --section filtering and by the JSON section field. When --section is given, regions is replaced with the matching subset of named_exec.

Fields§

§endian: Endianness

The byte order gadgets are decoded with.

§base: u64

The view’s image base, after any --base rebase.

§entry: u64

The image’s entry point, after any --base rebase.

§regions: Vec<Section>

The regions the scanner walks. Replaced by the --section subset when --section was given.

§named_exec: Vec<Section>

Every named executable section, for --section matching and for the JSON section field.

§universal: bool

True for Universal (multi-slice) binaries (JSON arch field).

Trait Implementations§

Source§

impl Image for RegionView

Source§

fn rebase(&mut self, new_base: u64)

Uniform slide of the whole view (for Universal: all slices slide by the same delta — our –base extension; ROPgadget has no –base for Universal).

Source§

fn arch(&self) -> Arch

The architecture the bytes are decoded as.
Source§

fn endianness(&self) -> Endianness

The byte order the bytes are decoded with.
Source§

fn image_base(&self) -> u64

Preferred load address (PE ImageBase, ELF min PT_LOAD p_vaddr, Mach-O __TEXT segment vmaddr, Raw 0).
Source§

fn entry(&self) -> u64

The image’s entry point, as an address in the current (possibly rebased) view.
Source§

fn exec_sections(&self) -> Vec<&Section>

Named executable sections (for --section filtering).
Source§

fn exec_scan_regions(&self) -> &[Section]

ROPgadget-compatible scan regions actually walked by the scanner.
Source§

fn addr_size(&self) -> usize

Address width in bytes, 4 or 8. Defaults to Arch::addr_size.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.