package binsec

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Binsec.Dba.Expr end
type t = private Binsec.Dba.Expr.t =
  1. | Var of Binsec.Dba.Var.t
  2. | Load of Binsec.Dba.size * Binsec.Machine.endianness * t * string option
  3. | Cst of Binsec.Bitvector.t
  4. | Unary of Binsec.Dba.Unary_op.t * t
  5. | Binary of Binsec.Dba.Binary_op.t * t * t
  6. | Ite of t * t * t
val size_of : t -> int
val is_equal : t -> t -> bool
val is_constant : t -> bool
val var : ?tag:Binsec.Dba.Var.Tag.t -> string -> int -> t

Constructors

val v : Binsec.Dba.Var.t -> t
val temporary : size:int -> string -> t
val constant : Binsec.Bitvector.t -> t

constant bv creates a constant expression from the bitvector bv.

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 _true : t
val _false : t
val binary : Binsec.Dba.Binary_op.t -> t -> t -> t

Binary expressions

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
include Binsec.Sigs.COMPARISON with type t := t and type boolean = t
type boolean = t
val equal : t -> t -> boolean
val diff : t -> t -> boolean
val ule : t -> t -> boolean
val uge : t -> t -> boolean
val ult : t -> t -> boolean
val ugt : t -> t -> boolean
val sle : t -> t -> boolean
val sge : t -> t -> boolean
val slt : t -> t -> boolean
val sgt : t -> t -> boolean
val unary : Binsec.Dba.Unary_op.t -> t -> t
val uminus : t -> t
include Binsec.Sigs.EXTENDED_LOGICAL with type t := t
include Binsec.Sigs.LOGICAL with type t := t
val logand : t -> t -> t
val logor : t -> t -> t
val lognot : t -> t
val logxor : t -> t -> t
val sext : int -> t -> t

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

val uext : int -> t -> t

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

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 ite : t -> t -> t -> t

ite cond then_e else_e creates Dba.ExprIte(cond, then_e, else_e)

val restrict : int -> 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

val load : ?array:string -> Binsec.Size.Byte.t -> Binsec.Machine.endianness -> t -> t

load nbytes endianness t

val is_max : t -> bool

is_max e is true if e is

  • constant; and
  • the maximum unsigned representable for the size of this expression
val neg : t -> t
val succ : t -> t
OCaml

Innovation. Community. Security.