Crate liblisa_enc

Expand description

This library contains libLISA’s encoding analysis and some parts of enumeration.

§Encoding Analysis

Encoding analysis can be invoked as follows:

use liblisa::arch::x64::X64Arch;
use liblisa::instr::Instruction;
use liblisa_enc::infer_encoding;
use liblisa_x64_observer::with_oracle;

let instr = Instruction::new(&[0x90]);
let encoding = with_oracle(|mut oracle| infer_encoding(&instr, &mut oracle)).unwrap();

println!("{encoding}");

§Enumeration

Two techniques for skipping invalid instructions or errors are implemented: tunneling and randomized search. See crate::random_search_skip_invalid_instrs and tunnel_invalid_instrs/tunnel_memory_errors.

Modules§

cache
Cache for analysis results.

Structs§

ChangeAnalysis
Determines Changes between the dataflows of two instructions.
DataflowAnalysis
Infers dataflows given an instruction and its MemoryAccesses.
EncodingAnalysis
Infers Encodings.
JsonThresholdValue
An efficent JSON representation of ThresholdValues.
JsonThresholdValues
A collection of JsonThresholdValues.
MemoryAccessAnalysis
Infers the MemoryAccesses for an Instruction.
ThresholdValues
A set of I/O examples for a destination, that identify the specific behavior of that destination.

Enums§

AccessAnalysisError
Error returned when MemoryAccessAnalysis fails.
AnalysisError
Wrapper that can contain an AccessAnalysisError, DataflowAnalysisError or EncodingError.
AnalysisResult
The result of running Encoding Analysis on an Instruction.
Change
A difference between two Dataflows.
ChangeLocation
The location in the Dataflows where a change occurred.
DataflowAnalysisError
Error returned when DataflowAnalysis fails.
EncodingError
Error returned when EncodingAnalysis fails.
FindInputError
Error returned in an AccessAnalysisError when no input registers can be found for an address calculation of a memory access.
InferEncodingError
Error returned by infer_encoding
Validity
Determines whether a byte string is too short, too long, invalid, out-of-scope, or a valid instruction.

Functions§

analyze
Runs Encoding Analysis on the provided Instruction.
infer_encoding
Infers an Encoding for the provided Instruction.
random_search_skip_invalid_instrs
Skip consecutive byte strings that are invalid instructions using randomized search.
tunnel_invalid_instrs
Skip byte strings that are invalid instructions using tunneling.
tunnel_memory_errors
Skip instructions for which crate::MemoryAccessAnalysis returns an error using tunneling.