pub trait Interpreter {
type V: DomainValue;
type M: DomainMemory<V = Self::V>;
// Required methods
fn ctx(&self) -> &Context<'_>;
fn memory(&mut self) -> &mut Self::M;
fn get_value(&mut self, id: ValueId) -> Result<Self::V, EmulatorErrorKind>;
// Provided methods
fn get_varnode_value(
&mut self,
id: VarnodeId,
) -> Result<Self::V, EmulatorErrorKind> { ... }
fn set_varnode_value(
&mut self,
id: VarnodeId,
value: Self::V,
) -> Result<(), EmulatorErrorKind> { ... }
fn get_register_value(
&mut self,
reg_id: RegisterId,
) -> Result<Self::V, EmulatorErrorKind> { ... }
fn set_register_value(
&mut self,
reg_id: RegisterId,
value: Self::V,
) -> Result<(), EmulatorErrorKind> { ... }
fn interpret_(
&mut self,
insn: &InstructionRef<'_, '_>,
mnemonic: &Mnemonic,
) -> Result<Option<Self::V>, EmulatorErrorKind> { ... }
fn interpret(
&mut self,
insn: InstructionRef<'_, '_>,
mnemonic: &Mnemonic,
) -> Result<Option<Self::V>> { ... }
}Required Associated Types§
type V: DomainValue
type M: DomainMemory<V = Self::V>
Required Methods§
Provided Methods§
Sourcefn get_varnode_value(
&mut self,
id: VarnodeId,
) -> Result<Self::V, EmulatorErrorKind>
fn get_varnode_value( &mut self, id: VarnodeId, ) -> Result<Self::V, EmulatorErrorKind>
Reads the value of a varnode from the emulated memory space.
Sourcefn set_varnode_value(
&mut self,
id: VarnodeId,
value: Self::V,
) -> Result<(), EmulatorErrorKind>
fn set_varnode_value( &mut self, id: VarnodeId, value: Self::V, ) -> Result<(), EmulatorErrorKind>
Writes a value to a varnode in the emulated memory space.
Sourcefn get_register_value(
&mut self,
reg_id: RegisterId,
) -> Result<Self::V, EmulatorErrorKind>
fn get_register_value( &mut self, reg_id: RegisterId, ) -> Result<Self::V, EmulatorErrorKind>
Returns the value of the given register, if it exists in the context.
Sourcefn set_register_value(
&mut self,
reg_id: RegisterId,
value: Self::V,
) -> Result<(), EmulatorErrorKind>
fn set_register_value( &mut self, reg_id: RegisterId, value: Self::V, ) -> Result<(), EmulatorErrorKind>
Sets the value of the given register, if it exists in the context.
Sourcefn interpret_(
&mut self,
insn: &InstructionRef<'_, '_>,
mnemonic: &Mnemonic,
) -> Result<Option<Self::V>, EmulatorErrorKind>
fn interpret_( &mut self, insn: &InstructionRef<'_, '_>, mnemonic: &Mnemonic, ) -> Result<Option<Self::V>, EmulatorErrorKind>
Gets the value of the given instruction, if it has one. This is used for instructions that produce a value, such as copy, load, and binary operations.
fn interpret( &mut self, insn: InstructionRef<'_, '_>, mnemonic: &Mnemonic, ) -> Result<Option<Self::V>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".