pub struct X86InstructionWriter { /* private fields */ }
Expand description
The x86/x86_64 instruction writer.
Implementations§
source§impl X86InstructionWriter
impl X86InstructionWriter
pub fn put_leave(&self) -> bool
pub fn put_ret(&self) -> bool
pub fn put_ret_imm(&self, imm: u16) -> bool
pub fn put_jmp_address(&self, address: u64) -> bool
pub fn put_jmp_short_label(&self, id: u64) -> bool
sourcepub fn put_jmp_near_label(&self, id: u64) -> bool
pub fn put_jmp_near_label(&self, id: u64) -> bool
Insert a jmp
near to a label. The label is specified by id
.
pub fn put_jmp_reg(&self, reg: X86Register) -> bool
pub fn put_jmp_reg_ptr(&self, reg: X86Register) -> bool
pub fn put_jmp_reg_offset_ptr(&self, reg: X86Register, offset: isize) -> bool
pub fn put_jmp_near_ptr(&self, address: u64) -> bool
pub fn put_jcc_short_label( &self, condition: X86BranchCondition, label_id: u64, hint: GumBranchHint )
pub fn put_jcc_near_label( &self, condition: X86BranchCondition, label_id: u64, hint: GumBranchHint )
pub fn put_mov_reg_gs_u32_ptr(&self, reg: X86Register, imm: u32) -> bool
pub fn put_add_reg_imm(&self, reg: X86Register, imm: isize) -> bool
pub fn put_add_reg_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_add_reg_near_ptr(&self, dst_reg: X86Register, address: u64) -> bool
pub fn put_sub_reg_imm(&self, dst_reg: X86Register, imm: isize) -> bool
pub fn put_sub_reg_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_sub_reg_near_ptr(&self, dst_reg: X86Register, address: u64) -> bool
pub fn put_inc_reg(&self, reg: X86Register) -> bool
pub fn put_dec_reg(&self, reg: X86Register) -> bool
pub fn put_and_reg_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_and_reg_u32(&self, reg: X86Register, imm: u32) -> bool
pub fn put_shl_reg_u8(&self, dst_reg: X86Register, imm: u8) -> bool
pub fn put_shr_reg_u8(&self, dst_reg: X86Register, imm: u8) -> bool
pub fn put_xor_reg_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_mov_reg_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_mov_reg_u32(&self, dst_reg: X86Register, imm: u32) -> bool
pub fn put_mov_reg_u64(&self, dst_reg: X86Register, imm: u64) -> bool
pub fn put_mov_reg_address(&self, dst_reg: X86Register, address: u64) -> bool
pub fn put_mov_reg_ptr_u32(&self, dst_reg: X86Register, imm: u32) -> bool
pub fn put_mov_reg_offset_ptr_u32( &self, dst_reg: X86Register, offset: isize, imm: u32 ) -> bool
pub fn put_mov_reg_ptr_reg( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_mov_reg_offset_ptr_reg( &self, dst_reg: X86Register, offset: isize, src_reg: X86Register ) -> bool
pub fn put_mov_reg_reg_ptr( &self, dst_reg: X86Register, src_reg: X86Register ) -> bool
pub fn put_mov_reg_reg_offset_ptr( &self, dst_reg: X86Register, src_reg: X86Register, offset: isize ) -> bool
pub fn put_mov_reg_base_index_scale_offset_ptr( &self, dst_reg: X86Register, base_reg: X86Register, index_reg: X86Register, scale: u8, offset: isize ) -> bool
sourcepub fn put_lea_reg_reg_offset(
&self,
dst_reg: X86Register,
src_reg: X86Register,
src_offset: isize
) -> bool
pub fn put_lea_reg_reg_offset( &self, dst_reg: X86Register, src_reg: X86Register, src_offset: isize ) -> bool
Insert a lea d, [s + o]
instruction.
pub fn put_push_u32(&self, imm: u32) -> bool
pub fn put_push_near_ptr(&self, address: u64) -> bool
sourcepub fn put_push_reg(&self, reg: X86Register) -> bool
pub fn put_push_reg(&self, reg: X86Register) -> bool
Insert a push R
instruction.
sourcepub fn put_pop_reg(&self, reg: X86Register) -> bool
pub fn put_pop_reg(&self, reg: X86Register) -> bool
Insert a pop R
instruction.
sourcepub fn put_call_address(&self, address: u64) -> bool
pub fn put_call_address(&self, address: u64) -> bool
Insert a call address instruction.
pub fn put_call_address_with_arguments( &self, address: u64, arguments: &[Argument] ) -> bool
pub fn put_call_address_with_aligned_arguments( &self, address: u64, arguments: &[Argument] ) -> bool
pub fn put_test_reg_reg(&self, reg_a: X86Register, reg_b: X86Register) -> bool
pub fn put_nop(&self) -> bool
pub fn put_pushfx(&self) -> bool
pub fn put_popfx(&self) -> bool
pub fn put_pushax(&self) -> bool
pub fn put_popax(&self) -> bool
Trait Implementations§
source§impl Drop for X86InstructionWriter
impl Drop for X86InstructionWriter
source§impl InstructionWriter for X86InstructionWriter
impl InstructionWriter for X86InstructionWriter
source§fn new(code_address: u64) -> Self
fn new(code_address: u64) -> Self
Create a new
InstructionWriter
to write code to the given addresssource§fn code_offset(&self) -> u64
fn code_offset(&self) -> u64
Retrieve the writer’s current code offset.
source§fn can_branch_directly_between(&self, source: u64, target: u64) -> bool
fn can_branch_directly_between(&self, source: u64, target: u64) -> bool
Check if we can branch directly between the given source and target addresses.
source§fn put_label(&self, id: u64) -> bool
fn put_label(&self, id: u64) -> bool
Add a label at the curent point in the instruction stream.
source§fn put_branch_address(&self, address: u64) -> bool
fn put_branch_address(&self, address: u64) -> bool
Add a branch to an immediate address
source§fn can_branch_directly_to(&self, target: u64) -> bool
fn can_branch_directly_to(&self, target: u64) -> bool
Check if we can branch directly to the target address from the current
program counter.
Auto Trait Implementations§
impl Freeze for X86InstructionWriter
impl RefUnwindSafe for X86InstructionWriter
impl !Send for X86InstructionWriter
impl !Sync for X86InstructionWriter
impl Unpin for X86InstructionWriter
impl UnwindSafe for X86InstructionWriter
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
Mutably borrows from an owned value. Read more