pub struct Registers { /* private fields */ }Expand description
Helpers for reading and writing register state of the traced process.
Registers stores a snapshot of the platform user_regs_struct for a
given Pid and provides convenience accessors. Currently this module
assumes x86_64 register layout.
Implementations§
Source§impl Registers
impl Registers
Sourcepub fn rip(&self) -> u64
pub fn rip(&self) -> u64
Instruction pointer (RIP).
§Returns
The current value of the instruction pointer (RIP) for the stored register snapshot.
Sourcepub fn set_rip(&mut self, value: u64)
pub fn set_rip(&mut self, value: u64)
Set the instruction pointer.
§Arguments
value- The new instruction pointer (RIP) value to store in the snapshot.
Sourcepub fn orig_rax(&self) -> u64
pub fn orig_rax(&self) -> u64
Return the original RAX value saved by the kernel (useful for syscalls).
§Returns
The orig_rax register value recorded by the kernel.
Sourcepub fn function_params(&self) -> [u64; 6]
pub fn function_params(&self) -> [u64; 6]
Return the 6 register parameters passed in registers for x86_64
(rdi, rsi, rdx, r10, r8, r9).
§Returns
An array with the six parameter registers as u64 in calling convention order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registers
impl RefUnwindSafe for Registers
impl Send for Registers
impl Sync for Registers
impl Unpin for Registers
impl UnsafeUnpin for Registers
impl UnwindSafe for Registers
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