Header menu logo B2R2

SymbStateAccessor Type

Provides convenience helpers for a symbolic state.

Constructors

Constructor Description

SymbStateAccessor(hdl, state)

Full Usage: SymbStateAccessor(hdl, state)

Parameters:
Returns: SymbStateAccessor
hdl : BinHandle
state : SymbState
Returns: SymbStateAccessor

SymbStateAccessor(hdl, state, os)

Full Usage: SymbStateAccessor(hdl, state, os)

Parameters:
Returns: SymbStateAccessor
hdl : BinHandle
state : SymbState
os : OS
Returns: SymbStateAccessor

Instance members

Instance member Description

this.AllocateStackBuffer

Full Usage: this.AllocateStackBuffer

Parameters:
    size : int

Returns: uint64

Allocate a buffer from the current stack and return its address.

size : int
Returns: uint64

this.AllocateSymbolicBuffer

Full Usage: this.AllocateSymbolicBuffer

Parameters:
    name : string
    length : int
    nullTerminate : bool

Returns: SymbByteBuffer

Allocates a stack buffer and fills it with symbolic bytes.

name : string
length : int
nullTerminate : bool
Returns: SymbByteBuffer

this.AllocateSymbolicBuffer

Full Usage: this.AllocateSymbolicBuffer

Parameters:
    name : string
    length : int

Returns: SymbByteBuffer

Allocates a stack buffer and fills it with symbolic bytes.

name : string
length : int
Returns: SymbByteBuffer

this.AllocateSymbolicString

Full Usage: this.AllocateSymbolicString

Parameters:
    name : string
    maxLength : int

Returns: SymbByteBuffer

Allocates a null-terminated symbolic C-string buffer on the stack.

name : string
maxLength : int
Returns: SymbByteBuffer

this.AllocateSymbolicString

Full Usage: this.AllocateSymbolicString

Parameters:
    name : string

Returns: SymbByteBuffer

Allocates a null-terminated symbolic C-string buffer on the stack.

name : string
Returns: SymbByteBuffer

this.CreateSymbolicBytes

Full Usage: this.CreateSymbolicBytes

Parameters:
    name : string
    length : int

Returns: SymbExpr list

Creates symbolic byte variables without writing them to memory.

name : string
length : int
Returns: SymbExpr list

this.GetRegister

Full Usage: this.GetRegister

Parameters:
Returns: SymbExpr

Get a register value by register ID.

rid : RegisterID
Returns: SymbExpr

this.GetRegister

Full Usage: this.GetRegister

Parameters:
    name : string

Returns: SymbExpr

Get a register value by name.

name : string
Returns: SymbExpr

this.GetReturnValue

Full Usage: this.GetReturnValue

Returns: SymbExpr

Get the return value for the supported ABI.

Returns: SymbExpr

this.InitializeDefaultStack

Full Usage: this.InitializeDefaultStack

Initialize the stack pointer with the default stack top.

this.InitializeFramePointer

Full Usage: this.InitializeFramePointer

Initialize the frame pointer with the current stack pointer.

this.InitializeStack

Full Usage: this.InitializeStack

Parameters:

Initialize the stack pointer with the given stack top.

stackTop : Addr

this.PopFromStack

Full Usage: this.PopFromStack

Returns: SymbExpr

Pop a word-sized value from the stack.

Returns: SymbExpr

this.PushToStack

Full Usage: this.PushToStack

Parameters:
Returns: uint64

Push a word-sized value to the stack and return its address.

value : SymbExpr
Returns: uint64

this.SetArgument

Full Usage: this.SetArgument

Parameters:

Set an integer or pointer argument for the supported ABI.

idx : int
value : SymbExpr

this.SetArgumentBuffer

Full Usage: this.SetArgumentBuffer

Parameters:

Sets an argument register to point to a symbolic byte buffer.

idx : int
buffer : SymbByteBuffer

this.SetArgumentSymbolicString

Full Usage: this.SetArgumentSymbolicString

Parameters:
    idx : int
    name : string
    maxLength : int

Returns: SymbByteBuffer

Allocates a symbolic C string and passes it as an argument.

idx : int
name : string
maxLength : int
Returns: SymbByteBuffer

this.SetArgumentSymbolicString

Full Usage: this.SetArgumentSymbolicString

Parameters:
    idx : int
    name : string

Returns: SymbByteBuffer

Allocates a symbolic C string and passes it as an argument.

idx : int
name : string
Returns: SymbByteBuffer

this.SetRegister

Full Usage: this.SetRegister

Parameters:

Set a register value by register ID.

rid : RegisterID
value : SymbExpr

this.SetRegister

Full Usage: this.SetRegister

Parameters:

Set a register value by name.

name : string
value : SymbExpr

this.SetStackPointer

Full Usage: this.SetStackPointer

Parameters:

Set the current stack pointer value.

addr : Addr

this.StackPointer

Full Usage: this.StackPointer

Returns: uint64

Current stack pointer value.

Returns: uint64

this.State

Full Usage: this.State

Returns: SymbState

The underlying symbolic state.

Returns: SymbState

this.TryGetConcreteRegister

Full Usage: this.TryGetConcreteRegister

Parameters:
Returns: Result<uint64, SymbEvalError>

Reads a register as a concrete address.

rid : RegisterID
Returns: Result<uint64, SymbEvalError>

this.TryGetStackPointer

Full Usage: this.TryGetStackPointer

Returns: Result<uint64, SymbEvalError>

Reads the stack pointer as a concrete address.

Returns: Result<uint64, SymbEvalError>

this.TryPopFromStack

Full Usage: this.TryPopFromStack

Returns: Result<SymbExpr, SymbEvalError>

Pops a word-sized value from the stack without throwing on failure.

Returns: Result<SymbExpr, SymbEvalError>

this.TryPushToStack

Full Usage: this.TryPushToStack

Parameters:
Returns: Result<uint64, SymbEvalError>

Pushes a word-sized value to the stack without throwing on failure.

value : SymbExpr
Returns: Result<uint64, SymbEvalError>

this.TrySetStackPointer

Full Usage: this.TrySetStackPointer

Parameters:
Returns: Result<unit, SymbEvalError>

Sets the stack pointer when the architecture provides one.

addr : Addr
Returns: Result<unit, SymbEvalError>

this.WordBytes

Full Usage: this.WordBytes

Returns: int

Target word size in bytes.

Returns: int

this.WordType

Full Usage: this.WordType

Returns: int<MeasureProduct<rt, MeasureOne>>

Target word-sized register type.

Returns: int<MeasureProduct<rt, MeasureOne>>

this.WordValue

Full Usage: this.WordValue

Parameters:
Returns: SymbExpr

Creates a word-sized concrete symbolic expression.

addr : Addr
Returns: SymbExpr

this.WriteSymbolicBuffer

Full Usage: this.WriteSymbolicBuffer

Parameters:
    name : string
    addr : uint64
    length : int
    nullTerminate : bool

Returns: SymbByteBuffer

Writes a symbolic byte buffer to memory at a concrete address.

name : string
addr : uint64
length : int
nullTerminate : bool
Returns: SymbByteBuffer

this.WriteSymbolicBuffer

Full Usage: this.WriteSymbolicBuffer

Parameters:
    name : string
    addr : uint64
    length : int

Returns: SymbByteBuffer

Writes a symbolic byte buffer to memory at a concrete address.

name : string
addr : uint64
length : int
Returns: SymbByteBuffer

this.ZeroRegisters

Full Usage: this.ZeroRegisters

Parameters:

Clear selected registers to zero.

rids : RegisterID[]

this.ZeroRegisters

Full Usage: this.ZeroRegisters

Parameters:
    names : string[]

Clear selected registers to zero.

names : string[]

Static members

Static member Description

SymbStateAccessor.DefaultStackTop

Full Usage: SymbStateAccessor.DefaultStackTop

Returns: uint64

Default stack top used by symbolic states.

Returns: uint64

SymbStateAccessor.DefaultStringBound

Full Usage: SymbStateAccessor.DefaultStringBound

Returns: int

Default maximum symbolic C-string payload size.

Returns: int

Type something to start searching.