Skip to main content

Opcode

Enum Opcode 

Source
#[repr(u8)]
pub enum Opcode {
Show 72 variants Copy = 1, Load = 2, Store = 3, Branch = 4, CBranch = 5, BranchInd = 6, Call = 7, CallInd = 8, CallOther = 9, Return = 10, IntEqual = 11, IntNotEqual = 12, IntSLess = 13, IntSLessEqual = 14, IntLess = 15, IntLessEqual = 16, IntZext = 17, IntSext = 18, IntAdd = 19, IntSub = 20, IntCarry = 21, IntSCarry = 22, IntSBorrow = 23, Int2Comp = 24, IntNegate = 25, IntXor = 26, IntAnd = 27, IntOr = 28, IntLeft = 29, IntRight = 30, IntSRight = 31, IntMult = 32, IntDiv = 33, IntSDiv = 34, IntRem = 35, IntSRem = 36, BoolNegate = 37, BoolXor = 38, BoolAnd = 39, BoolOr = 40, FloatEqual = 41, FloatNotEqual = 42, FloatLess = 43, FloatLessEqual = 44, FloatNan = 46, FloatAdd = 47, FloatDiv = 48, FloatMult = 49, FloatSub = 50, FloatNeg = 51, FloatAbs = 52, FloatSqrt = 53, FloatInt2Float = 54, FloatFloat2Float = 55, FloatTrunc = 56, FloatCeil = 57, FloatFloor = 58, FloatRound = 59, MultiEqual = 60, Indirect = 61, Piece = 62, SubPiece = 63, Cast = 64, PtrAdd = 65, PtrSub = 66, SegmentOp = 67, CpoolRef = 68, New = 69, Insert = 70, Extract = 71, PopCount = 72, LzCount = 73,
}
Expand description

An opcode from Ghidra’s p-code operation reference.

The variants use Rust-style names; each maps one-for-one to Ghidra’s CPUI_* opcode with the corresponding uppercase spelling. Some variants are analysis-only pseudo-operations and are identified by Self::is_raw_instruction_op.

Variants§

§

Copy = 1

§

Load = 2

§

Store = 3

§

Branch = 4

§

CBranch = 5

§

BranchInd = 6

§

Call = 7

§

CallInd = 8

§

CallOther = 9

§

Return = 10

§

IntEqual = 11

§

IntNotEqual = 12

§

IntSLess = 13

§

IntSLessEqual = 14

§

IntLess = 15

§

IntLessEqual = 16

§

IntZext = 17

§

IntSext = 18

§

IntAdd = 19

§

IntSub = 20

§

IntCarry = 21

§

IntSCarry = 22

§

IntSBorrow = 23

§

Int2Comp = 24

§

IntNegate = 25

§

IntXor = 26

§

IntAnd = 27

§

IntOr = 28

§

IntLeft = 29

§

IntRight = 30

§

IntSRight = 31

§

IntMult = 32

§

IntDiv = 33

§

IntSDiv = 34

§

IntRem = 35

§

IntSRem = 36

§

BoolNegate = 37

§

BoolXor = 38

§

BoolAnd = 39

§

BoolOr = 40

§

FloatEqual = 41

§

FloatNotEqual = 42

§

FloatLess = 43

§

FloatLessEqual = 44

§

FloatNan = 46

§

FloatAdd = 47

§

FloatDiv = 48

§

FloatMult = 49

§

FloatSub = 50

§

FloatNeg = 51

§

FloatAbs = 52

§

FloatSqrt = 53

§

FloatInt2Float = 54

§

FloatFloat2Float = 55

§

FloatTrunc = 56

§

FloatCeil = 57

§

FloatFloor = 58

§

FloatRound = 59

§

MultiEqual = 60

§

Indirect = 61

§

Piece = 62

§

SubPiece = 63

§

Cast = 64

§

PtrAdd = 65

§

PtrSub = 66

§

SegmentOp = 67

§

CpoolRef = 68

§

New = 69

§

Insert = 70

§

Extract = 71

§

PopCount = 72

§

LzCount = 73

Implementations§

Source§

impl Opcode

Source

pub const ALL: &[Self]

Every opcode in Ghidra’s p-code operation reference.

Source

pub const fn ghidra_id(self) -> u8

Returns Ghidra’s numeric CPUI_* opcode value.

Source

pub const fn is_raw_instruction_op(self) -> bool

Returns whether this opcode may occur in raw instruction p-code.

Ghidra reserves SSA and type-recovery pseudo-operations for later analysis. INSERT and EXTRACT are likewise pseudo-operations even though they correspond to SLEIGH bit-range syntax.

Trait Implementations§

Source§

impl Clone for Opcode

Source§

fn clone(&self) -> Opcode

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 Copy for Opcode

Source§

impl Debug for Opcode

Source§

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

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

impl<'de> Deserialize<'de> for Opcode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Opcode

Source§

impl Hash for Opcode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Opcode

Source§

fn eq(&self, other: &Opcode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Opcode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Opcode

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.