Function x86_decode_single
pub fn x86_decode_single(
bytes: &[u8],
bitness: u32,
base_address: u64,
offset: u64,
) -> Result<X86DecodedInstruction>Expand description
Decode a single instruction at the given offset.
This is useful for on-demand decoding during analysis, such as when exploring indirect jump targets or validating specific code locations.
§Arguments
bytes- The x86/x64 machine code bytesbitness- 32 for x86, 64 for x64base_address- The base address (RVA) of the codeoffset- Offset withinbytesto decode at
§Returns
The decoded instruction at the specified offset.
§Errors
Returns crate::Error::X86Error if:
bytesis emptybitnessis not 32 or 64offsetis beyond the end ofbytes- The instruction at
offsetis invalid