pub struct InjectionBuilder { /* private fields */ }Expand description
An injection builder holding the target address, returned by
Injection::at.
Implementations§
Source§impl InjectionBuilder
impl InjectionBuilder
Sourcepub fn code(self, code: &[u8]) -> InjectionWith
pub fn code(self, code: &[u8]) -> InjectionWith
Injects the caller’s own machine code at the target.
The bytes are copied, so the slice needn’t outlive this call. The code
must follow the ABI rules of install.
Sourcepub fn asm<F>(self, build: F) -> InjectionWith
pub fn asm<F>(self, build: F) -> InjectionWith
Injects machine code written as assembly.
build appends to an asm::CodeAssembler;
pass Rust values as operands, e.g. a.mov(rax, some_addr). It’s
assembled at the stub’s real address, so rip-relative operands resolve,
and the jump back is appended. The ABI rules of
install apply.
Sourcepub fn inspect<F>(self, callback: F) -> InjectionWith
pub fn inspect<F>(self, callback: F) -> InjectionWith
Sourcepub fn modify<F>(self, callback: F) -> InjectionWith
pub fn modify<F>(self, callback: F) -> InjectionWith
Auto Trait Implementations§
impl !Send for InjectionBuilder
impl !Sync for InjectionBuilder
impl Freeze for InjectionBuilder
impl RefUnwindSafe for InjectionBuilder
impl Unpin for InjectionBuilder
impl UnsafeUnpin for InjectionBuilder
impl UnwindSafe for InjectionBuilder
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