package binsec

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type nonrec size = Binsec.Term.size
type nonrec 'a interval = 'a Binsec.Term.interval = {
  1. lo : 'a;
  2. hi : 'a;
}
type nonrec endianness = Binsec.Term.endianness =
  1. | LittleEndian
  2. | BigEndian
type ('k, 'l, 'a, 'b) term = private ('k, 'l, 'a, 'b) Binsec.Term.t =
  1. | Var : {
    1. hash : int;
    2. size : size;
    3. name : string;
    4. label : 'a;
    } -> (Binsec.Term.exp, _, 'a, _) term
  2. | Load : {
    1. hash : int;
    2. len : size;
    3. dir : endianness;
    4. addr : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    5. label : 'b;
    } -> (Binsec.Term.exp, _, 'a, 'b) term
  3. | Cst : Binsec.Bitvector.t -> (_, Binsec.Term.exp, _, _) term
  4. | Unary : {
    1. hash : int;
    2. size : size;
    3. f : Binsec.Term.unary Binsec.Term.operator;
    4. x : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    } -> (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term
  5. | Binary : {
    1. hash : int;
    2. size : size;
    3. f : Binsec.Term.binary Binsec.Term.operator;
    4. x : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    5. y : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    } -> (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term
  6. | Ite : {
    1. hash : int;
    2. size : size;
    3. c : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    4. t : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    5. e : (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term;
    } -> (Binsec.Term.exp, Binsec.Term.exp, 'a, 'b) term

Constructors

val var : string -> size -> string -> t

var name bitsize label

val load : size -> endianness -> t -> Memory.t -> t

load nbytes endianness addr label

val constant : Binsec.Bitvector.t -> t

constant bv creates a constant expression from the bitvector bv.

val unary : Binsec.Term.unary op -> t -> t

unary f x creates a unary application of f on x.

val binary : Binsec.Term.binary op -> t -> t -> t

binary f x y creates a binary application of f on x and y.

val ite : t -> t -> t -> t

ite c t e creates an if-then-else expression c ? t : e.

val uminus : t -> t
val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val smod : t -> t -> t
val umod : t -> t -> t
val udiv : t -> t -> t
val sdiv : t -> t -> t
val append : t -> t -> t
val equal : t -> t -> t
val diff : t -> t -> t
val ule : t -> t -> t
val uge : t -> t -> t
val ult : t -> t -> t
val ugt : t -> t -> t
val sle : t -> t -> t
val sge : t -> t -> t
val slt : t -> t -> t
val sgt : t -> t -> t
val logand : t -> t -> t
val logor : t -> t -> t
val lognot : t -> t
val logxor : t -> t -> t
val shift_left : t -> t -> t
val shift_right : t -> t -> t
val shift_right_signed : t -> t -> t

shift_(left|right) e q shifts expression e by quantity q, padding with zeroes

val rotate_left : t -> t -> t
val rotate_right : t -> t -> t

rotate_(left|right) e q rotates expression e by quantity q

val sext : size -> t -> t

sext sz e performs a signed extension of expression e to size sz

val uext : size -> t -> t

uext sz e performs an unsigned extension expression e to size sz

val restrict : lo:int -> hi:int -> t -> t

restrict lo hi e creates Dba.ExprUnary(Restrict(lo, hi), e) if hi >= lo && lo >=0 .

val bit_restrict : int -> t -> t

bit_restrict o e is restrict o o e

Specific constants

val zeros : int -> t

zeros n creates a constant expression of value 0 with length n

val ones : int -> t

ones n creates a constant expression of value 1 with length n. I.e.; it has (n - 1) zeros in binary.

val one : t
val zero : t
val addi : t -> int -> t
Utils

*

val hash : t -> int

hash t returns the hash of t in constant time.

val is_equal : t -> t -> bool
val compare : t -> t -> int
val sizeof : t -> size

sizeof t returns the bit size of t in constant time.

val map : ('a -> string) -> ('b -> Memory.t) -> (_, _, 'a, 'b) term -> t
OCaml

Innovation. Community. Security.