X64

Struct X64 

Source
pub struct X64;
Expand description

x86_64 (64-bit) architecture

Trait Implementations§

Source§

impl Architecture for X64

Source§

const JMP_REL_SIZE: usize = 5usize

size of a near relative jump instruction (jmp rel32)
Source§

const JMP_ABS_SIZE: usize = 14usize

size of an absolute jump stub (varies by architecture)
Source§

const PTR_SIZE: usize = 8usize

native pointer size in bytes
Source§

const CODE_ALIGNMENT: usize = 16usize

required alignment for executable code
Source§

const MIN_HOOK_SIZE: usize = 5usize

minimum bytes needed to install a hook typically JMP_REL_SIZE for near targets, JMP_ABS_SIZE for far
Source§

fn encode_jmp_rel(source: usize, target: usize) -> Option<Vec<u8>>

encode a near relative jump from source to target Read more
Source§

fn encode_jmp_abs(target: usize) -> Vec<u8>

encode an absolute jump (architecture-specific stub)
Source§

fn encode_call_rel(source: usize, target: usize) -> Option<Vec<u8>>

encode a relative call instruction Read more
Source§

fn encode_nop_sled(size: usize) -> Vec<u8>

encode a NOP sled of the specified size
Source§

fn find_instruction_boundary(code: &[u8], required_size: usize) -> Option<usize>

find instruction boundary at or after required_size bytes Read more
Source§

fn relocate_instruction( instruction: &[u8], old_address: usize, new_address: usize, ) -> Option<Vec<u8>>

relocate an instruction that was moved to a new address Read more
Source§

fn needs_relocation(instruction: &[u8]) -> bool

check if an instruction needs relocation when moved
Source§

fn preferred_hook_size(target: usize, detour: usize) -> usize

preferred hook method based on distance between target and detour

Auto Trait Implementations§

§

impl Freeze for X64

§

impl RefUnwindSafe for X64

§

impl Send for X64

§

impl Sync for X64

§

impl Unpin for X64

§

impl UnwindSafe for X64

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.