Crate liblisa

Expand description

libLISA is a library for automated discovery and analysis of CPU instructions. This crate is the core library that can be used to load and manipulate already-analyzed datasets. Several separate crates are available for enumeration, synthesis and architecture support:

§Loading semantics from disk

Encodings support serde, and can be serialized and deserialized by any library that supports serde. By default, libLISA uses JSON. You can import these semantics as follows:

use std::fs::File;
use std::io::BufReader;
use std::path::PathBuf;

use liblisa::encoding::Encoding;
use liblisa::semantics::default::computation::SynthesizedComputation;
use liblisa::arch::x64::X64Arch;

let file = File::open("semantics.json").unwrap();
let reader = BufReader::new(file);
let semantics: Vec<Encoding<X64Arch, SynthesizedComputation>> =
    serde_json::from_reader(reader).unwrap();

See encoding::Encoding for how these semantics can be used.

§Features

  • z3: adds the z3 crate as a dependency, and enables the Z3 implementation for smt::SmtSolver.
  • x64-undef: enables the arch::x64::undef namespace, which uses the XED disassembler library to provide definitions for undefined behavior.

Re-exports§

Modules§

  • All traits needed to define an architecture.
  • Provides various ways to compare crate::encoding::Encodings.
  • The main component of libLISA’s semantics is an Encoding. An encoding represents a group of instructions with similar semantics.
  • InstructionFilters are used to reason over instruction space. An encoding can return a set of filters representing the instruction space it covers.
  • Defines the trait Oracle, which represents a CPU observer oracle.
  • Semantics are defined in terms of Computations.
  • A generic interface for SMT solvers.
  • CPU state representation, efficient representations of modifications to CPU state, and CPU state randomization.
  • Contains various utility functions needed by other parts of libLISA.
  • A Value is an integer or byte sequence in a CPU state or dataflow.