Skip to main content

Registers

Struct Registers 

Source
pub struct Registers {
Show 49 fields pub rax: u64, pub rbx: u64, pub rcx: u64, pub rdx: u64, pub rbp: u64, pub rsi: u64, pub rdi: u64, pub rsp: u64, pub r8: u64, pub r9: u64, pub r10: u64, pub r11: u64, pub r12: u64, pub r13: u64, pub r14: u64, pub r15: u64, pub rip: u64, pub rflags: Rflags, pub cr0: Cr0, pub cr2: Cr2, pub cr3: Cr3, pub cr4: Cr4, pub dr0: Dr0, pub dr1: Dr1, pub dr2: Dr2, pub dr3: Dr3, pub dr6: Dr6, pub dr7: Dr7, pub cs: SegmentDescriptor, pub ds: SegmentDescriptor, pub es: SegmentDescriptor, pub fs: SegmentDescriptor, pub gs: SegmentDescriptor, pub ss: SegmentDescriptor, pub tr: SegmentDescriptor, pub ldtr: SegmentDescriptor, pub idtr: Idtr, pub gdtr: Gdtr, pub sysenter_cs: u64, pub sysenter_esp: u64, pub sysenter_eip: u64, pub shadow_gs: u64, pub msr_flags: u64, pub msr_lstar: u64, pub msr_star: u64, pub msr_cstar: u64, pub msr_syscall_mask: u64, pub msr_efer: MsrEfer, pub msr_tsc_aux: u64,
}
Available on crate feature arch-amd64 only.
Expand description

The state of the CPU registers.

Fields§

§rax: u64§rbx: u64§rcx: u64§rdx: u64§rbp: u64§rsi: u64§rdi: u64§rsp: u64§r8: u64§r9: u64§r10: u64§r11: u64§r12: u64§r13: u64§r14: u64§r15: u64§rip: u64§rflags: Rflags§cr0: Cr0§cr2: Cr2§cr3: Cr3§cr4: Cr4§dr0: Dr0§dr1: Dr1§dr2: Dr2§dr3: Dr3§dr6: Dr6§dr7: Dr7§cs: SegmentDescriptor§ds: SegmentDescriptor§es: SegmentDescriptor§fs: SegmentDescriptor§gs: SegmentDescriptor§ss: SegmentDescriptor§tr: SegmentDescriptor§ldtr: SegmentDescriptor§idtr: Idtr§gdtr: Gdtr§sysenter_cs: u64§sysenter_esp: u64§sysenter_eip: u64§shadow_gs: u64§msr_flags: u64§msr_lstar: u64§msr_star: u64§msr_cstar: u64§msr_syscall_mask: u64§msr_efer: MsrEfer§msr_tsc_aux: u64

Trait Implementations§

Source§

impl Clone for Registers

Source§

fn clone(&self) -> Registers

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Registers

Source§

impl Debug for Registers

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Registers

Source§

fn default() -> Registers

Returns the “default value” for a type. Read more
Source§

impl Eq for Registers

Source§

impl From<&Registers> for UnwindContextAmd64

Source§

fn from(value: &Registers) -> UnwindContextAmd64

Converts to this type from the input type.
Source§

impl PartialEq for Registers

Source§

fn eq(&self, other: &Registers) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Registers for Registers

Source§

type Architecture = Amd64

The specific CPU architecture implementation.
Source§

type GpRegisters = GpRegisters

General-purpose registers of the architecture. Read more
Source§

fn instruction_pointer(&self) -> u64

Returns the current value of the instruction pointer. Read more
Source§

fn set_instruction_pointer(&mut self, ip: u64)

Sets the value of the instruction pointer. Read more
Source§

fn stack_pointer(&self) -> u64

Returns the current value of the stack pointer. Read more
Source§

fn set_stack_pointer(&mut self, sp: u64)

Sets the value of the stack pointer. Read more
Source§

fn result(&self) -> u64

Returns the current value of the result register. Read more
Source§

fn set_result(&mut self, result: u64)

Sets the value of the result register. Read more
Source§

fn gp_registers(&self) -> GpRegisters

Returns a copy of all general-purpose registers.
Source§

fn set_gp_registers(&mut self, gp: &GpRegisters)

Sets all general-purpose registers.
Source§

fn address_width(&self) -> usize

Returns the native address width (i.e. pointer size) of the architecture in bytes. Read more
Source§

fn effective_address_width(&self) -> usize

Returns the effective address width, which may differ from the native width (e.g., in compatibility modes). Read more
Source§

fn access_context(&self, va: Va) -> AccessContext

Creates an access context for a given virtual address.
Source§

fn address_context(&self, va: Va) -> AddressContext

Creates an address context for a given virtual address.
Source§

fn translation_root(&self, _va: Va) -> Pa

Returns the physical address of the root of the current page table hierarchy for a given virtual address. Read more
Source§

fn set_translation_root(&mut self, root: u64, _va: Va)

Sets the physical address of the root of the current page table hierarchy for a given virtual address. Read more
Source§

fn return_address<Driver>(&self, vmi: &VmiCore<Driver>) -> Result<Va, VmiError>
where Driver: VmiRead,

Attempts to determine the return address of the current function call. Read more
Source§

fn return_from_function<Driver>( &self, vmi: &VmiCore<Driver>, value: u64, ) -> Result<<Registers as Registers>::GpRegisters, VmiError>
where Driver: VmiRead<Architecture = Amd64>,

Builds the general-purpose registers that make the current function return value to its caller without executing its body. Read more
Source§

impl StructuralPartialEq for Registers

Source§

impl WindowsRegistersAdapter for Registers

Source§

fn write_context(&mut self, context: &impl WindowsContext)

Writes general-purpose registers, instruction pointer, flags, and segment selectors.
Source§

fn write_special_registers( &mut self, special_registers: &impl WindowsSpecialRegisters, )

Writes control registers, debug registers, and descriptor tables.

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more