Skip to main content

ScanRequest

Struct ScanRequest 

Source
pub struct ScanRequest {
Show 22 fields pub depth: usize, pub rop: bool, pub jop: bool, pub sys: bool, pub multibr: bool, pub only: Option<String>, pub filter: Option<String>, pub range: Option<String>, pub badbytes: Option<String>, pub offset: Option<String>, pub base: Option<String>, pub section: Vec<String>, pub thumb: bool, pub cfg_aware: bool, pub align: Option<usize>, pub call_preceded: bool, pub all: bool, pub noinstr: bool, pub arch: Option<String>, pub max_gadgets: Option<usize>, pub max_memory: Option<usize>, pub compat: bool,
}
Expand description

The shared request layer, re-exported so that rf_cli::ScanRequest and rf_api::ScanRequest stay one type and every existing use rf_cli::… keeps compiling. The definitions live in rf-api. Scan inputs at the same string level as the CLI flags, so both front ends share parsing and validation.

Fields§

§depth: usize

--depth: how many bytes back from an anchor a gadget may start.

§rop: bool

Search the ROP anchor table (--norop clears it).

§jop: bool

Search the JOP anchor table (--nojop clears it).

§sys: bool

Search the SYS anchor table (--nosys clears it).

§multibr: bool

--multibr: allow branches in the middle of a gadget.

§only: Option<String>

--only: a |-separated mnemonic set; every instruction must match.

§filter: Option<String>

--filter: a |-separated regex alternation, full-matched against each mnemonic; a gadget with a match is dropped.

§range: Option<String>

--range: "0xSTART-0xEND". "0x0-0x0" means no range.

§badbytes: Option<String>

--badbytes: "bb|bb|lo-hi", rejected in the FINAL address.

§offset: Option<String>

--offset (hex): added to gadget addresses at emission.

§base: Option<String>

--base (hex): the image base to rebase to before scanning.

§section: Vec<String>

--section: glob patterns naming the executable sections to scan.

§thumb: bool

--thumb: decode 32-bit ARM in T32 mode.

§cfg_aware: bool

CFG/CET-aware scan (Phase 4b): keep only endbr64/endbr32-entering gadgets.

§align: Option<usize>

ROPgadget –align: anchor-stepping alignment override (engine semantics, gadgets.py:66-67 — NOT a post-filter).

§call_preceded: bool

ROPgadget –callPreceded: capture prev bytes for the CLI filter.

§all: bool

ROPgadget –all: skip dedup.

§noinstr: bool

ROPgadget –noinstr: skip dedup and sort; print bare addresses.

§arch: Option<String>

Fat Mach-O slice selection (CORE-03/CORE-05), as the --arch spelling (x86_64, arm64, …). None on a multi-slice container is a REFUSAL, not a guess.

§max_gadgets: Option<usize>

PERF-05 --max-gadgets: abort with a budget error once this many gadgets have been accepted. None = unbounded.

§max_memory: Option<usize>

PERF-05 --max-memory: abort with a budget error once the retained gadgets are estimated to exceed this many heap bytes.

§compat: bool

--compat: reproduce ROPgadget bug-for-bug where rop-finder deliberately differs (today: scan a multi-slice fat Mach-O as the concatenation instead of refusing it).

Trait Implementations§

Source§

impl Clone for ScanRequest

Source§

fn clone(&self) -> ScanRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ScanRequest

Source§

fn default() -> ScanRequest

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.