Header menu logo B2R2

Expr Type

Represents a LowUIR expression. You must create Expr/Stmt through the AST module. NEVER directly construct Expr nor Stmt unless you know what you are doing.

Union cases

Union case Description

BinOp(BinOpType, RegType, Expr, Expr, HashConsingInfo)

Full Usage: BinOp(BinOpType, RegType, Expr, Expr, HashConsingInfo)

Parameters:

Binary operation such as add, sub, etc. The second argument is a result type after applying BinOp.

Item1 : BinOpType
Item2 : RegType
Item3 : Expr
Item4 : Expr
Item5 : HashConsingInfo

Cast(CastKind, RegType, Expr, HashConsingInfo)

Full Usage: Cast(CastKind, RegType, Expr, HashConsingInfo)

Parameters:

Type casting expression. The first argument is a casting type, and the second argument is a result type.

Item1 : CastKind
Item2 : RegType
Item3 : Expr
Item4 : HashConsingInfo

ExprList(Expr list, HashConsingInfo)

Full Usage: ExprList(Expr list, HashConsingInfo)

Parameters:

List of expressions. We use this to represent function arguments.

Item1 : Expr list
Item2 : HashConsingInfo

Extract(Expr, RegType, startPos, HashConsingInfo)

Full Usage: Extract(Expr, RegType, startPos, HashConsingInfo)

Parameters:

Extraction expression. The first argument is target expression, and the second argument is the number of bits for extraction, and the third is the start position.

Item1 : Expr
Item2 : RegType
startPos : int
Item4 : HashConsingInfo

FuncName(string, HashConsingInfo)

Full Usage: FuncName(string, HashConsingInfo)

Parameters:

Name of uninterpreted function.

Item1 : string
Item2 : HashConsingInfo

Ite(Expr, Expr, Expr, HashConsingInfo)

Full Usage: Ite(Expr, Expr, Expr, HashConsingInfo)

Parameters:

If-then-else expression. The first expression is a condition, and the second and the third are true and false expression respectively.

Item1 : Expr
Item2 : Expr
Item3 : Expr
Item4 : HashConsingInfo

JmpDest(Label, HashConsingInfo)

Full Usage: JmpDest(Label, HashConsingInfo)

Parameters:

Jump destination of a Jmp or CJmp statement.

Item1 : Label
Item2 : HashConsingInfo

Load(Endian, RegType, Expr, HashConsingInfo)

Full Usage: Load(Endian, RegType, Expr, HashConsingInfo)

Parameters:

Memory loading such as LE:[T_1:I32]

Item1 : Endian
Item2 : RegType
Item3 : Expr
Item4 : HashConsingInfo

Num(BitVector, HashConsingInfo)

Full Usage: Num(BitVector, HashConsingInfo)

Parameters:

A number. For example, (0x42:I32) is a 32-bit number 0x42

Item1 : BitVector
Item2 : HashConsingInfo

PCVar(RegType, string, HashConsingInfo)

Full Usage: PCVar(RegType, string, HashConsingInfo)

Parameters:

A variable that represents a Program Counter (PC) of a CPU.

Item1 : RegType
Item2 : string
Item3 : HashConsingInfo

RelOp(RelOpType, Expr, Expr, HashConsingInfo)

Full Usage: RelOp(RelOpType, Expr, Expr, HashConsingInfo)

Parameters:

Relative operation such as eq, lt, etc.

Item1 : RelOpType
Item2 : Expr
Item3 : Expr
Item4 : HashConsingInfo

TempVar(RegType, int, HashConsingInfo)

Full Usage: TempVar(RegType, int, HashConsingInfo)

Parameters:

A temporary variable represents an internal (imaginary) register. Names of temporary variables should always be affixed by an underscore (_) and a number. This is to make sure that any temporary variable is unique in a CFG. For example, a temporary variable T can be represented as (T_2:I32), where 2 is a unique number assigned to the variable.

Item1 : RegType
Item2 : int
Item3 : HashConsingInfo

UnOp(UnOpType, Expr, HashConsingInfo)

Full Usage: UnOp(UnOpType, Expr, HashConsingInfo)

Parameters:

Unary operation such as negation.

Item1 : UnOpType
Item2 : Expr
Item3 : HashConsingInfo

Undefined(RegType, string, HashConsingInfo)

Full Usage: Undefined(RegType, string, HashConsingInfo)

Parameters:

Undefined expression. This is rarely used, and it is a fatal error when we encounter this expression while evaluating a program. Some CPU manuals explicitly say that a register value is undefined after a certain operation. We model such cases with this expression.

Item1 : RegType
Item2 : string
Item3 : HashConsingInfo

Var(RegType, RegisterID, string, HashConsingInfo)

Full Usage: Var(RegType, RegisterID, string, HashConsingInfo)

Parameters:

A variable that represents a register of a CPU. Var (t, r, n) indicates a variable of type (t) that has RegisterID r and name (n). For example, (EAX:I32) represents the EAX register (of type I32). Note that name (n) is additional information that doesn't be used internally.

Item1 : RegType
Item2 : RegisterID
Item3 : string
Item4 : HashConsingInfo

Instance members

Instance member Description

this.Hash

Full Usage: this.Hash

Returns: int
Modifiers: inline

Retrives the hash value of the expression. If hash consing is not used, this will raise an exception.

Returns: int

this.ID

Full Usage: this.ID

Returns: uint32
Modifiers: inline

Retrives the unique ID of the expression. If hash consing is not used, this will raise an exception.

Returns: uint32

this.IsBinOp

Full Usage: this.IsBinOp

Returns: bool
Returns: bool

this.IsCast

Full Usage: this.IsCast

Returns: bool
Returns: bool

this.IsExprList

Full Usage: this.IsExprList

Returns: bool
Returns: bool

this.IsExtract

Full Usage: this.IsExtract

Returns: bool
Returns: bool

this.IsFuncName

Full Usage: this.IsFuncName

Returns: bool
Returns: bool

this.IsIte

Full Usage: this.IsIte

Returns: bool
Returns: bool

this.IsJmpDest

Full Usage: this.IsJmpDest

Returns: bool
Returns: bool

this.IsLoad

Full Usage: this.IsLoad

Returns: bool
Returns: bool

this.IsNum

Full Usage: this.IsNum

Returns: bool
Returns: bool

this.IsPCVar

Full Usage: this.IsPCVar

Returns: bool
Returns: bool

this.IsRelOp

Full Usage: this.IsRelOp

Returns: bool
Returns: bool

this.IsTempVar

Full Usage: this.IsTempVar

Returns: bool
Returns: bool

this.IsUnOp

Full Usage: this.IsUnOp

Returns: bool
Returns: bool

this.IsUndefined

Full Usage: this.IsUndefined

Returns: bool
Returns: bool

this.IsVar

Full Usage: this.IsVar

Returns: bool
Returns: bool

Static members

Static member Description

Expr.AppendToString(expr, sb)

Full Usage: Expr.AppendToString(expr, sb)

Parameters:
expr : Expr
sb : StringBuilder

Expr.HashBinOp(op, rt, e1, e2, hasCache)

Full Usage: Expr.HashBinOp(op, rt, e1, e2, hasCache)

Parameters:
    op : ^a
    rt : ^b
    e1 : Expr
    e2 : Expr
    hasCache : bool

Returns: int
Modifiers: inline
Type parameters: ^a, ^b
op : ^a
rt : ^b
e1 : Expr
e2 : Expr
hasCache : bool
Returns: int

Expr.HashCast(kind, rt, e, hasCache)

Full Usage: Expr.HashCast(kind, rt, e, hasCache)

Parameters:
Returns: int
Modifiers: inline
Type parameters: ^a
kind : ^a
rt : RegType
e : Expr
hasCache : bool
Returns: int

Expr.HashExprList(exprs, hasCache)

Full Usage: Expr.HashExprList(exprs, hasCache)

Parameters:
    exprs : Expr list
    hasCache : bool

Returns: int
Modifiers: inline
exprs : Expr list
hasCache : bool
Returns: int

Expr.HashExtract(e, rt, pos, hasCache)

Full Usage: Expr.HashExtract(e, rt, pos, hasCache)

Parameters:
Returns: int
Modifiers: inline
e : Expr
rt : RegType
pos : int
hasCache : bool
Returns: int

Expr.HashFuncName(s)

Full Usage: Expr.HashFuncName(s)

Parameters:
    s : string

Returns: int
Modifiers: inline
s : string
Returns: int

Expr.HashIte(cond, t, f, hasCache)

Full Usage: Expr.HashIte(cond, t, f, hasCache)

Parameters:
Returns: int
Modifiers: inline
cond : Expr
t : Expr
f : Expr
hasCache : bool
Returns: int

Expr.HashJmpDest(lbl)

Full Usage: Expr.HashJmpDest(lbl)

Parameters:
Returns: int
Modifiers: inline
lbl : Label
Returns: int

Expr.HashLoad(endian, rt, e, hasCache)

Full Usage: Expr.HashLoad(endian, rt, e, hasCache)

Parameters:
Returns: int
Modifiers: inline
Type parameters: ^a
endian : ^a
rt : RegType
e : Expr
hasCache : bool
Returns: int

Expr.HashPCVar(rt)

Full Usage: Expr.HashPCVar(rt)

Parameters:
Returns: int
Modifiers: inline
rt : RegType
Returns: int

Expr.HashRelOp(op, e1, e2, hasCache)

Full Usage: Expr.HashRelOp(op, e1, e2, hasCache)

Parameters:
    op : ^a
    e1 : Expr
    e2 : Expr
    hasCache : bool

Returns: int
Modifiers: inline
Type parameters: ^a
op : ^a
e1 : Expr
e2 : Expr
hasCache : bool
Returns: int

Expr.HashTempVar(rt, n)

Full Usage: Expr.HashTempVar(rt, n)

Parameters:
Returns: int
Modifiers: inline
rt : RegType
n : int
Returns: int

Expr.HashUnOp(op, e, hasCache)

Full Usage: Expr.HashUnOp(op, e, hasCache)

Parameters:
Returns: int
Modifiers: inline
op : UnOpType
e : Expr
hasCache : bool
Returns: int

Expr.HashUndef(rt, s)

Full Usage: Expr.HashUndef(rt, s)

Parameters:
Returns: int
Modifiers: inline
rt : RegType
s : string
Returns: int

Expr.HashVar(rt, rid)

Full Usage: Expr.HashVar(rt, rid)

Parameters:
Returns: int
Modifiers: inline
rt : RegType
rid : RegisterID
Returns: int

Expr.ToString(expr)

Full Usage: Expr.ToString(expr)

Parameters:
Returns: string
expr : Expr
Returns: string

Expr.TypeOf(expr)

Full Usage: Expr.TypeOf(expr)

Parameters:
Returns: RegType

Gets the type of an expression.

expr : Expr
Returns: RegType

Type something to start searching.