Skip to main content

Module decode

Module decode 

Source
Expand description

Turning a register snapshot into “this instruction, touching these addresses”.

Given the state of a vCPU before an instruction executes, this module

  1. fetches the instruction bytes from guest memory (fetch),
  2. decodes them with iced-x86,
  3. computes the linear address of every memory access the instruction will make (plan_accesses), including the implicit ones (stack pushes, string operands, gather elements), and
  4. predicts where execution will go next (predict_successors), so that the tracer can check that exactly one instruction ran.

Structs§

Decoded
A decoded instruction and the bytes it came from.
PlannedAccess
One memory access the instruction is going to attempt.
VectorRegs
The SIMD register file, needed only to compute gather/scatter addresses.

Enums§

Successors
Where execution can go after this instruction.

Functions§

fetch
Fetches and decodes the instruction at the vCPU’s current CS:RIP.
gpr_value
Value of a general-purpose register (any width) from a snapshot.
io_permission_accesses
The reads the CPU makes to check I/O permission before IN, OUT, INS or OUTS.
is_rep_string
Is this a REP/REPE/REPNE string instruction?
may_clear_tf
Instructions after which the tracer must re-arm single-stepping, because they can load RFLAGS.TF from memory or a register (and the value they load may not have TF set).
needs_vector_regs
Does this instruction use VSIB addressing (gather/scatter)?
plan_accesses
Computes every memory access d will attempt when executed from state.
predict_successors
Predicts the RIP after d executes from state.
rep_count
The count register a REP string instruction uses, by address size.