package binsec

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Dba.ExprSource

Sourcetype t = private
  1. | Var of Var.t
  2. | Load of size * endianness * t * string option
  3. | Cst of Binsec_base.Bitvector.t
  4. | Unary of Unary_op.t * t
  5. | Binary of Binary_op.t * t * t
  6. | Ite of t * t * t
Sourceval size_of : t -> int
Sourceval is_equal : t -> t -> bool
Sourceval is_constant : t -> bool
Sourceval var : ?tag:Var.Tag.t -> string -> int -> t

Constructors

Sourceval v : Var.t -> t
Sourceval temporary : size:int -> string -> t

constant bv creates a constant expression from the bitvector bv.

Specific constants

Sourceval zeros : int -> t

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

Sourceval ones : int -> t

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

Sourceval one : t
Sourceval zero : t
Sourceval _true : t
Sourceval _false : t
Sourceval binary : Binary_op.t -> t -> t -> t

Binary expressions

Sourceval add : t -> t -> t
Sourceval addi : t -> int -> t

Same as add e (constant (Bitvector.of_int i ~size:(size_of e)))

Sourceval addz : t -> Z.t -> t

Same as add e (constant (Bitvector.create z (size_of e)))

Sourceval sub : t -> t -> t
Sourceval subi : t -> int -> t

Same as sub e (constant (Bitvector.of_int i ~size:(size_of e)))

Sourceval subz : t -> Z.t -> t

Same as sub e (constant (Bitvector.create z (size_of e)))

Sourceval mul : t -> t -> t
Sourceval srem : t -> t -> t
Sourceval urem : t -> t -> t
Sourceval udiv : t -> t -> t
Sourceval sdiv : t -> t -> t
Sourceval append : t -> t -> t
include Binsec_base.Sigs.COMPARISON with type t := t and type boolean = t
Sourcetype boolean = t
Sourceval equal : t -> t -> boolean
Sourceval diff : t -> t -> boolean
Sourceval ule : t -> t -> boolean
Sourceval uge : t -> t -> boolean
Sourceval ult : t -> t -> boolean
Sourceval ugt : t -> t -> boolean
Sourceval sle : t -> t -> boolean
Sourceval sge : t -> t -> boolean
Sourceval slt : t -> t -> boolean
Sourceval sgt : t -> t -> boolean
Sourceval unary : Unary_op.t -> t -> t
Sourceval uminus : t -> t
include Binsec_base.Sigs.EXTENDED_LOGICAL with type t := t
include Binsec_base.Sigs.LOGICAL with type t := t
Sourceval logand : t -> t -> t
Sourceval logor : t -> t -> t
Sourceval lognot : t -> t
Sourceval logxor : t -> t -> t
Sourceval sext : int -> t -> t

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

Sourceval uext : int -> t -> t

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

Sourceval shift_left : t -> t -> t
Sourceval shift_right : t -> t -> t
Sourceval shift_right_signed : t -> t -> t

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

Sourceval rotate_left : t -> t -> t
Sourceval rotate_right : t -> t -> t

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

Sourceval ite : t -> t -> t -> t

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

Sourceval restrict : int -> int -> t -> t

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

Sourceval bit_restrict : int -> t -> t

bit_restrict o e is restrict o o e

Sourceval load : ?array:string -> Binsec_base.Size.Byte.t -> endianness -> t -> t

load nbytes endianness t

Sourceval is_max : t -> bool

is_max e is true if e is

  • constant; and
  • the maximum unsigned representable for the size of this expression