Mips32Shell

Struct Mips32Shell 

Source
pub struct Mips32Shell { /* private fields */ }

Implementations§

Source§

impl Mips32Shell

Source

pub fn New(endian: Endian) -> Self

Source

pub fn Lui(&mut self, rt: Mips32Register, number: u16)

Source

pub fn Ori(&mut self, rt: Mips32Register, rs: Mips32Register, number: u16)

Source

pub fn Or(&mut self, rd: Mips32Register, rt: Mips32Register, rs: Mips32Register)

Source

pub fn Li(&mut self, register: Mips32Register, number: u32)

Source

pub fn Add( &mut self, rd: Mips32Register, rs: Mips32Register, rt: Mips32Register, )

Source

pub fn Addi(&mut self, rt: Mips32Register, rs: Mips32Register, imm: i16)

Source

pub fn Addiu(&mut self, rt: Mips32Register, rs: Mips32Register, imm: u16)

Source

pub fn Sub( &mut self, rd: Mips32Register, rs: Mips32Register, rt: Mips32Register, )

Source

pub fn Subu( &mut self, rd: Mips32Register, rs: Mips32Register, rt: Mips32Register, )

Source

pub fn Subi(&mut self, rt: Mips32Register, rs: Mips32Register, imm: i16)

Source

pub fn Xori(&mut self, rt: Mips32Register, rs: Mips32Register, imm: u16)

Source

pub fn Mult(&mut self, rs: Mips32Register, rt: Mips32Register)

Source

pub fn Multu(&mut self, rs: Mips32Register, rt: Mips32Register)

Source

pub fn Mfhi(&mut self, rd: Mips32Register)

Source

pub fn Mflo(&mut self, rd: Mips32Register)

Source

pub fn Lb(&mut self, rt: Mips32Register, rs: Mips32Register, offset: i16)

Source

pub fn Lhu(&mut self, rt: Mips32Register, rs: Mips32Register, offset: i16)

Source

pub fn Lw(&mut self, rt: Mips32Register, rs: Mips32Register, offset: i16)

Source

pub fn Sh(&mut self, rt: Mips32Register, rs: Mips32Register, offset: i16)

Source

pub fn Sw(&mut self, rt: Mips32Register, rs: Mips32Register, offset: i16)

Source

pub fn Slt( &mut self, rd: Mips32Register, rs: Mips32Register, rt: Mips32Register, )

Source

pub fn Sltu( &mut self, rd: Mips32Register, rs: Mips32Register, rt: Mips32Register, )

Source

pub fn Slti(&mut self, rt: Mips32Register, rs: Mips32Register, imm: i16)

Source

pub fn Sltiu(&mut self, rt: Mips32Register, rs: Mips32Register, imm: u16)

Source

pub fn Bne(&mut self, rs: Mips32Register, rt: Mips32Register, offset: i16)

Offset is instruction count, aka byte offset>>2

Source

pub fn Beq(&mut self, rs: Mips32Register, rt: Mips32Register, offset: i16)

Offset is instruction count, aka byte offset>>2

Source

pub fn Sync(&mut self)

Source

pub fn Syscall(&mut self, imm: usize)

Call syscall with provided 20 bits imm value imm value can be anything, 0x40404 is normally used to avoid null byte

Source

pub fn PushU32(&mut self, value: u32)

Push 32 bits number Endian depend on shellcode endian Subtract $sp by 4

Source

pub fn PushU64(&mut self, value: u64)

Push 64 bits number Endian depend on shellcode endian Subtract $sp by 8

Source

pub fn PushU128(&mut self, value: u128)

Push 128 bits number Endian depend on shellcode endian Subtract $sp by 16

Source

pub fn PushByteArray(&mut self, data: &[u8]) -> usize

Push a byte array to stack Always pad data array to 8 bytes align with null byte Return the number of $sp subtracted

Source

pub fn PushString(&mut self, string: &str) -> usize

Push a string to stack, with null byte appended

Source

pub fn GetLabel(&self) -> usize

Get a label to use in later branch call Label is number of instruction so far Label only valid in one shellcode instance

Source

pub fn BeqLabel(&mut self, rs: Mips32Register, rt: Mips32Register, label: usize)

Branch to label if rs is equa to rt

Source

pub fn BneLabel(&mut self, rs: Mips32Register, rt: Mips32Register, label: usize)

Branch to label if rs is not equa to rt

Source

pub fn ToByteArray(&self) -> Vec<u8>

Return the shellcode as byte array

Source

pub fn ToAssemblySource(&self) -> String

Return the assembly source of this shellcode

Trait Implementations§

Source§

impl Clone for Mips32Shell

Source§

fn clone(&self) -> Mips32Shell

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Mips32Shell

Source§

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

Formats the value using the given formatter. 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.