pub struct Emulator<'a, T> { /* private fields */ }
Expand description
An instruction emulator.
Implementations§
Source§impl<'a, T: Cpu> Emulator<'a, T>
impl<'a, T: Cpu> Emulator<'a, T>
Sourcepub fn new(cpu: T, vendor: Vendor, bytes: &'a [u8]) -> Self
pub fn new(cpu: T, vendor: Vendor, bytes: &'a [u8]) -> Self
Creates new emulator with the given CPU and initial state.
Sourcepub fn linear_ip(&mut self, offset: u64) -> Option<u64>
pub fn linear_ip(&mut self, offset: u64) -> Option<u64>
Gets the linear IP of the CPU, taking into account the code segment.
Returns None if IP/EIP does not fit into the code segment.
Sourcepub fn is_user_mode(&mut self) -> bool
pub fn is_user_mode(&mut self) -> bool
Gets whether the CPU was running in user mode before the emulator was invoked
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Emulator<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Emulator<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Emulator<'a, T>where
T: Send,
impl<'a, T> Sync for Emulator<'a, T>where
T: Sync,
impl<'a, T> Unpin for Emulator<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Emulator<'a, T>where
T: UnwindSafe,
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