Struct X64Arch
pub struct X64Arch;
Expand description
Defines the x86-64 architecture.
Trait Implementations§
§impl Arch for X64Arch
impl Arch for X64Arch
§const PAGE_BITS: usize = 12usize
const PAGE_BITS: usize = 12usize
The number of bits that are used in a page.
The page size is
2**PAGE_BITS
.
For example, for a page size of 4096 bytes PAGE_BITS
would be 12
.§const PC: Self::GpReg = {transmute(0x05): <arch::x64::X64Arch as arch::Arch>::GpReg}
const PC: Self::GpReg = {transmute(0x05): <arch::x64::X64Arch as arch::Arch>::GpReg}
The program counter register.
§const ZERO: Self::GpReg = {transmute(0x14): <arch::x64::X64Arch as arch::Arch>::GpReg}
const ZERO: Self::GpReg = {transmute(0x14): <arch::x64::X64Arch as arch::Arch>::GpReg}
The zero register.
If the architecture does not explicitly list a zero register, you can invent one.
§const INSTRUCTION_ALIGNMENT: usize = 1usize
const INSTRUCTION_ALIGNMENT: usize = 1usize
The alignment of the instructions. Must be a multiple of 2.
§type GpReg = GpReg
type GpReg = GpReg
The general-purpose register representation.
This should be equal to
Self::Reg
, or be a subset.
General-purpose registers must be integers (see crate::value::ValueType
). Read more§fn reg(reg: Self::GpReg) -> Self::Reg
fn reg(reg: Self::GpReg) -> Self::Reg
Converts a general-purpose register into a generic register.
This must always succeed.
§fn iter_regs() -> impl Iterator<Item = Self::Reg>
fn iter_regs() -> impl Iterator<Item = Self::Reg>
Returns an iterator that iterates over all registers.
The zero register must not be included, as it is not a real register.
§fn iter_gpregs() -> impl Iterator<Item = Self::GpReg>
fn iter_gpregs() -> impl Iterator<Item = Self::GpReg>
Returns an iterator that iterates over all general-purpose registers.
The zero register must not be included, as it is not a real register.
§impl CpuState<X64Arch> for X64State
impl CpuState<X64Arch> for X64State
§type DiffMask = DiffMask
type DiffMask = DiffMask
The type of the difference mask used in
CpuState::find_dataflows_masked
. Read more§fn state_byte_to_reg(byte: StateByte) -> (<X64Arch as Arch>::Reg, usize)
fn state_byte_to_reg(byte: StateByte) -> (<X64Arch as Arch>::Reg, usize)
Converts a state byte to a register.
Inverse of
CpuState::reg_to_state_byte
.§fn reg_to_state_byte(reg: <X64Arch as Arch>::Reg, byte: usize) -> StateByte
fn reg_to_state_byte(reg: <X64Arch as Arch>::Reg, byte: usize) -> StateByte
Converts a (register, byte index) tuple to a state byte.
Inverse of
CpuState::state_byte_to_reg
.§fn find_differences<F: FnMut(StateByte)>(&self, other: &Self, found: &mut F)
fn find_differences<F: FnMut(StateByte)>(&self, other: &Self, found: &mut F)
Enumerates over all differences between the two state pairs.
Calls
found
for each state byte that differs between self
and other
.
The call order is unspecified.§fn create_diff_mask<I: Iterator<Item = StateByte>>(items: I) -> Self::DiffMask
fn create_diff_mask<I: Iterator<Item = StateByte>>(items: I) -> Self::DiffMask
Creates a mask of state bytes whose differences can be ignored.
§fn get_state_byte(&self, byte: StateByte) -> u8
fn get_state_byte(&self, byte: StateByte) -> u8
Returns the value of the byte
byte
in the CPU state.§fn set_state_byte(&mut self, byte: StateByte, value: u8)
fn set_state_byte(&mut self, byte: StateByte, value: u8)
Sets the value of the byte
byte
in the CPU state.§fn state_bytes_unequal(&self, dest: StateByte, other: &Self) -> bool
fn state_bytes_unequal(&self, dest: StateByte, other: &Self) -> bool
Returns true if the value of the specified state byte in
self
is not equal to the value in other
.§fn find_dataflows_masked<F: FnMut(StateByte)>(
b: SystemStateIoPair<'_, X64Arch>,
a: SystemStateIoPair<'_, X64Arch>,
dest_diff_mask: &Self::DiffMask,
diff_mask: &Self::DiffMask,
found: &mut F,
)
fn find_dataflows_masked<F: FnMut(StateByte)>( b: SystemStateIoPair<'_, X64Arch>, a: SystemStateIoPair<'_, X64Arch>, dest_diff_mask: &Self::DiffMask, diff_mask: &Self::DiffMask, found: &mut F, )
Enumerates over all differences between the two state pairs.
Calls
found
for each state byte that differs between self
and other
.
diff_mask
is a hint of differences that can be ignored.
Therefore, this function may call found
even for state bytes that can be ignored according to diff_mask
.§fn create<R: FnMut(A::Reg, MutValue<'_>)>(regval: R) -> Self
fn create<R: FnMut(A::Reg, MutValue<'_>)>(regval: R) -> Self
Creates a new CPU state using
regval
to determine the values of the registers. Read more§fn default_with_pc(pc: u64) -> Self
fn default_with_pc(pc: u64) -> Self
Creates a default state with the program counter set to
pc
.§fn state_bytes_equal(&self, dest: StateByte, other: &Self) -> bool
fn state_bytes_equal(&self, dest: StateByte, other: &Self) -> bool
Returns true if the value of the specified state byte in
self
is equal to the value in other
.§impl<'de> Deserialize<'de> for X64Arch
impl<'de> Deserialize<'de> for X64Arch
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl JsonSchema for X64Arch
impl JsonSchema for X64Arch
§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read more§impl Ord for X64Arch
impl Ord for X64Arch
§impl PartialOrd for X64Arch
impl PartialOrd for X64Arch
§impl UndefProvider<X64Arch> for IntelUndefWithXed
impl UndefProvider<X64Arch> for IntelUndefWithXed
§fn undefined_outputs_of(
&self,
instr: &[u8],
) -> Result<UndefinedOutputs<X64Arch>, Self::Error>
fn undefined_outputs_of( &self, instr: &[u8], ) -> Result<UndefinedOutputs<X64Arch>, Self::Error>
Returns a list of outputs that can be undefined, and the conditions under which they are undefined.
impl Copy for X64Arch
impl Eq for X64Arch
impl StructuralPartialEq for X64Arch
Auto Trait Implementations§
impl Freeze for X64Arch
impl RefUnwindSafe for X64Arch
impl Send for X64Arch
impl Sync for X64Arch
impl Unpin for X64Arch
impl UnwindSafe for X64Arch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more