pub struct Encoder { /* private fields */ }Expand description
instruction encoder with builder API
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
create encoder with pre-allocated capacity
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
consume encoder and return bytes
Sourcepub fn push_imm32(&mut self, value: u32) -> &mut Self
pub fn push_imm32(&mut self, value: u32) -> &mut Self
PUSH imm32
Sourcepub fn call_rel32(&mut self, from: usize, to: usize) -> &mut Self
pub fn call_rel32(&mut self, from: usize, to: usize) -> &mut Self
CALL rel32 (5 bytes)
Sourcepub fn jmp_abs64(&mut self, target: u64) -> &mut Self
pub fn jmp_abs64(&mut self, target: u64) -> &mut Self
JMP [RIP+0] with absolute address (14 bytes, x64)
Sourcepub fn mov_rax_imm64(&mut self, value: u64) -> &mut Self
pub fn mov_rax_imm64(&mut self, value: u64) -> &mut Self
MOV RAX, imm64 (10 bytes, x64)
Sourcepub fn call_abs64(&mut self, target: u64) -> &mut Self
pub fn call_abs64(&mut self, target: u64) -> &mut Self
CALL [RIP+0] with absolute address (14 bytes, x64)
Sourcepub fn sub_rsp_imm8(&mut self, value: i8) -> &mut Self
pub fn sub_rsp_imm8(&mut self, value: i8) -> &mut Self
SUB RSP, imm8 (x64)
Sourcepub fn add_rsp_imm8(&mut self, value: i8) -> &mut Self
pub fn add_rsp_imm8(&mut self, value: i8) -> &mut Self
ADD RSP, imm8 (x64)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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