pub enum TerminatorClass {
Ret,
RetImm,
JmpReg,
JmpMem,
CallReg,
CallMem,
Syscall,
Far,
Other,
}Expand description
The nine-way terminator classification the query layer filters on.
This is the vocabulary CLS-09 asks for. It is derived, not stored:
Classification::terminator_class
folds Terminator together with
TerminatorTarget, so there is exactly one source of truth for what a
gadget’s terminator is.
Variants§
Ret
A bare near return.
RetImm
ret imm16 — returns, and also advances the stack pointer.
JmpReg
jmp reg.
JmpMem
jmp [mem].
CallReg
call reg.
CallMem
call [mem].
Syscall
A syscall/interrupt gate.
Far
A far or privilege-changing transfer: retf, iret, jmp far,
call far.
Other
Anything else — a direct jmp/call to a fixed address, or no
terminator at all.
Implementations§
Source§impl TerminatorClass
impl TerminatorClass
Sourcepub const ALL: &'static [&'static str]
pub const ALL: &'static [&'static str]
Every accepted value, for a parameter-validation error message.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The serialized spelling: "ret", "ret-imm", "jmp-reg",
"jmp-mem", "call-reg", "call-mem", "syscall", "far",
"other".
Sourcepub fn parse(s: &str) -> Option<TerminatorClass>
pub fn parse(s: &str) -> Option<TerminatorClass>
Parse the serialized spelling.
Trait Implementations§
Source§impl Clone for TerminatorClass
impl Clone for TerminatorClass
impl Copy for TerminatorClass
Source§impl Debug for TerminatorClass
impl Debug for TerminatorClass
impl Eq for TerminatorClass
Source§impl Hash for TerminatorClass
impl Hash for TerminatorClass
Source§impl Ord for TerminatorClass
impl Ord for TerminatorClass
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TerminatorClass
impl PartialEq for TerminatorClass
Source§impl PartialOrd for TerminatorClass
impl PartialOrd for TerminatorClass
Source§impl Serialize for TerminatorClass
impl Serialize for TerminatorClass
impl StructuralPartialEq for TerminatorClass
Auto Trait Implementations§
impl Freeze for TerminatorClass
impl RefUnwindSafe for TerminatorClass
impl Send for TerminatorClass
impl Sync for TerminatorClass
impl Unpin for TerminatorClass
impl UnsafeUnpin for TerminatorClass
impl UnwindSafe for TerminatorClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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