B2R2


BinHandle Type

The main handle for reading/parsing a binary code. BinHandle essentially provides a low-level interface for a chunk of binary code. One can use BinHandle to parse/lift/disassemble instructions at a specific address or to access file-specific data.

Record fields

Record Field Description

DisasmHelper

Full Usage: DisasmHelper

Field type: DisasmHelper
Field type: DisasmHelper

FileInfo

Full Usage: FileInfo

Field type: FileInfo
Field type: FileInfo

ISA

Full Usage: ISA

Field type: ISA
Field type: ISA

OS

Full Usage: OS

Field type: OS
Field type: OS

Parser

Full Usage: Parser

Field type: Parser
Field type: Parser

RegisterBay

Full Usage: RegisterBay

Field type: RegisterBay
Field type: RegisterBay

TranslationContext

Full Usage: TranslationContext

Field type: TranslationContext
Field type: TranslationContext

Instance members

Instance member Description

this.ReadASCII(bp)

Full Usage: this.ReadASCII(bp)

Parameters:
Returns: string Return the corresponding ASCII string.

Return the ASCII string pointed to by the binary pointer from the given BinHandle.

bp : BinaryPointer

BinaryPointer.

Returns: string

Return the corresponding ASCII string.

this.ReadASCII(addr)

Full Usage: this.ReadASCII(addr)

Parameters:
    addr : Addr - The address.

Returns: string Return the corresponding ASCII string.

Return the ASCII string at the addr from the given BinHandle.

addr : Addr

The address.

Returns: string

Return the corresponding ASCII string.

this.ReadBytes(bp, nBytes)

Full Usage: this.ReadBytes(bp, nBytes)

Parameters:
    bp : BinaryPointer - BInaryPointer.
    nBytes : int - The size of the byte array (in bytes).

Returns: byte[] Return the byte array if succeed. Otherwise, raise an exception.

Return the byte array of size (nBytes) pointed to by the binary pointer (bp).

bp : BinaryPointer

BInaryPointer.

nBytes : int

The size of the byte array (in bytes).

Returns: byte[]

Return the byte array if succeed. Otherwise, raise an exception.

this.ReadBytes(addr, nBytes)

Full Usage: this.ReadBytes(addr, nBytes)

Parameters:
    addr : Addr - The address.
    nBytes : int - The size of the byte array (in bytes).

Returns: byte[] Return the byte array if succeed. Otherwise, raise an exception.

Return the byte array of size (nBytes) at the addr from the current binary.

addr : Addr

The address.

nBytes : int

The size of the byte array (in bytes).

Returns: byte[]

Return the byte array if succeed. Otherwise, raise an exception.

this.ReadInt(bp, size)

Full Usage: this.ReadInt(bp, size)

Parameters:
    bp : BinaryPointer - The binary pointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64 Return the corresponding integer (int64).

Return the corresponding integer value of the size from the current binary, which is pointed to by the binary pointer (bp).

bp : BinaryPointer

The binary pointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64

Return the corresponding integer (int64).

this.ReadInt(addr, size)

Full Usage: this.ReadInt(addr, size)

Parameters:
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64 Return the corresponding integer (int64).

Return the corresponding integer value at the addr of the size from the current binary.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64

Return the corresponding integer (int64).

this.ReadUInt(bp, size)

Full Usage: this.ReadUInt(bp, size)

Parameters:
    bp : BinaryPointer - BinaryPointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64 Return the corresponding unsigned integer (uint64).

Return the corresponding unsigned integer value of the size from the binary, which is pointed to by the binary pointer (bp).

bp : BinaryPointer

BinaryPointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64

Return the corresponding unsigned integer (uint64).

this.ReadUInt(addr, size)

Full Usage: this.ReadUInt(addr, size)

Parameters:
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64 Return the corresponding unsigned integer (uint64).

Return the corresponding unsigned integer value at the addr of the size from the binary.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64

Return the corresponding unsigned integer (uint64).

Static members

Static member Description

BinHandle.DisasmBBlock(hdl, showAddr, resolveSymbol, bp)

Full Usage: BinHandle.DisasmBBlock(hdl, showAddr, resolveSymbol, bp)

Parameters:
Returns: Result<(string * BinaryPointer), (string * BinaryPointer)>

Return the disassembled string for a basic block starting at address pointed to by the binary pointer (bp) along with the fall-through address of the block. This function returns a partial disassembly if parsing of the bblock was not successful.

hdl : BinHandle
showAddr : bool
resolveSymbol : bool
bp : BinaryPointer
Returns: Result<(string * BinaryPointer), (string * BinaryPointer)>

BinHandle.DisasmBBlock(hdl, showAddr, resolveSymbol, addr)

Full Usage: BinHandle.DisasmBBlock(hdl, showAddr, resolveSymbol, addr)

Parameters:
    hdl : BinHandle
    showAddr : bool
    resolveSymbol : bool
    addr : Addr

Returns: Result<(string * Addr), (string * Addr)>

Return the disassembled string for a basic block starting at the given address along with the fall-through address of the block. This function returns a partial disassembly if parsing of the bblock was not successful.

hdl : BinHandle
showAddr : bool
resolveSymbol : bool
addr : Addr
Returns: Result<(string * Addr), (string * Addr)>

BinHandle.DisasmInstr(hdl) (showAddr) (resolveSymbol) (ins)

Full Usage: BinHandle.DisasmInstr(hdl) (showAddr) (resolveSymbol) (ins)

Parameters:
    hdl : BinHandle - BinHandle.
    showAddr : bool - Whether to show the instruction address or not.
    resolveSymbol : bool - Whether to resolve symbols while disassembling the instruction.
    ins : Instruction - The instruction to disassemble.

Returns: string Disassembled string.

Return a disassembled string from the parsed instruction.

hdl : BinHandle

BinHandle.

showAddr : bool

Whether to show the instruction address or not.

resolveSymbol : bool

Whether to resolve symbols while disassembling the instruction.

ins : Instruction

The instruction to disassemble.

Returns: string

Disassembled string.

BinHandle.DisasmInstrSimple(ins)

Full Usage: BinHandle.DisasmInstrSimple(ins)

Parameters:
Returns: string Disassembled string.

Return a disassembled string from the parsed instruction. This function returns a simplified disassembly, which does not contain the instruction address nor symbols.

ins : Instruction

The instruction to disassemble.

Returns: string

Disassembled string.

BinHandle.Init(isa, os)

Full Usage: BinHandle.Init(isa, os)

Parameters:
    isa : ISA - ISA.
    os : OS - OS.

Returns: BinHandle BinHandle.

Initialize an empty BinHandle. This function is useful when you want to delay loading the actual body of your binary blob but also want to specify the os.

isa : ISA

ISA.

os : OS

OS.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa)

Full Usage: BinHandle.Init(isa)

Parameters:
    isa : ISA - ISA.

Returns: BinHandle BinHandle.

Initialize an empty BinHandle solely from an ISA, assuming that the archMode is NoMode, and the format is RawBinary. This function is useful when you want to delay loading the actual body of your binary blob.

isa : ISA

ISA.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, archMode)

Full Usage: BinHandle.Init(isa, archMode)

Parameters:
Returns: BinHandle BinHandle.

Initialize an empty BinHandle. This function is useful when you want to delay loading the actual body of your binary blob.

isa : ISA

ISA.

archMode : ArchOperationMode

ArchOperatinoMode.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, bytes)

Full Usage: BinHandle.Init(isa, bytes)

Parameters:
    isa : ISA - ISA.
    bytes : byte[] - Byte sequence.

Returns: BinHandle BinHandle.

Initialize a BinHandle from an ISA and a byte sequence, assuming that the archMode is NoMode, and the format is RawBinary.

isa : ISA

ISA.

bytes : byte[]

Byte sequence.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, fileName)

Full Usage: BinHandle.Init(isa, fileName)

Parameters:
    isa : ISA - ISA.
    fileName : string - Binary file path.

Returns: BinHandle BinHandle.

Initialize a BinHandle from an ISA and a binary file path, assuming that the archMode is NoMode. B2R2 will automatically detect the file format of the given binary file, but it will refer to the given ISA parameter either when the binary has multiple architectures, e.g., a fat binary on macOS, or when B2R2 cannot recognize the given file format. If the given binary file does not follow the known formats, then B2R2 consider it as a raw binary with base address at 0.

isa : ISA

ISA.

fileName : string

Binary file path.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, baseAddr, bytes)

Full Usage: BinHandle.Init(isa, baseAddr, bytes)

Parameters:
    isa : ISA - ISA.
    baseAddr : Addr option - Base address.
    bytes : byte[] - Byte sequence.

Returns: BinHandle BinHandle.

Initialize a BinHandle from an ISA and a byte sequence, assuming that the archMode is NoMode. This function behaves the same as the 2-argument constructor Init (isa, bytes), with a difference of using the specified base address when initializing the BinHandle.

isa : ISA

ISA.

baseAddr : Addr option

Base address.

bytes : byte[]

Byte sequence.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, baseAddr, fileName)

Full Usage: BinHandle.Init(isa, baseAddr, fileName)

Parameters:
    isa : ISA - ISA.
    baseAddr : Addr option - Base address.
    fileName : string - Binary file path.

Returns: BinHandle BinHandle.

Initialize a BinHandle from an ISA and a binary file path, assuming that the archMode is NoMode. This function behaves the same as the 2-argument constructor Init (isa, fileName), with a difference of using the specified base address when initializing the BinHandle.

isa : ISA

ISA.

baseAddr : Addr option

Base address.

fileName : string

Binary file path.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, archMode, autoDetect, baseAddr, fileName)

Full Usage: BinHandle.Init(isa, archMode, autoDetect, baseAddr, fileName)

Parameters:
    isa : ISA - ISA.
    archMode : ArchOperationMode - ArchOperatinoMode.
    autoDetect : bool - Whether to perform auto format detection.
    baseAddr : Addr option - Base address for calculating instruction addresses.
    fileName : string - Binary file.

Returns: BinHandle BinHandle.

Initialize a BinHandle from a given binary file (fileName). This function will read the file and parse it. It will automatically detect the file format if autoDetect is true. Otherwise, it will cnosider the file as a raw binary.

isa : ISA

ISA.

archMode : ArchOperationMode

ArchOperatinoMode.

autoDetect : bool

Whether to perform auto format detection.

baseAddr : Addr option

Base address for calculating instruction addresses.

fileName : string

Binary file.

Returns: BinHandle

BinHandle.

BinHandle.Init(isa, archMode, autoDetect, baseAddr, bytes)

Full Usage: BinHandle.Init(isa, archMode, autoDetect, baseAddr, bytes)

Parameters:
    isa : ISA - ISA.
    archMode : ArchOperationMode - ArchOperatinoMode.
    autoDetect : bool - Perform auto format detection or not.
    baseAddr : Addr option - Base address for calculating instruction addresses.
    bytes : byte[] - Raw binary sequence.

Returns: BinHandle BinHandle.

Initialize a BInHnalder from a given binary byte sequence. This function will read the byte sequence and automatically detect its binary format if autoDetect is true. Otherwise, it will consider the given binary sequence as a raw binary (just a series of machine instructions without specific file format).

isa : ISA

ISA.

archMode : ArchOperationMode

ArchOperatinoMode.

autoDetect : bool

Perform auto format detection or not.

baseAddr : Addr option

Base address for calculating instruction addresses.

bytes : byte[]

Raw binary sequence.

Returns: BinHandle

BinHandle.

BinHandle.LiftBBlock(hdl, bp)

Full Usage: BinHandle.LiftBBlock(hdl, bp)

Parameters:
Returns: Result<(Stmt[] * BinaryPointer), (Stmt[] * BinaryPointer)>

Return the lifted IR (an array of statements) of a basic block pointed to by the binary pointer (bp). This function returns a partial bblock with Error, if the parsing of the bblock was not successful.

hdl : BinHandle
bp : BinaryPointer
Returns: Result<(Stmt[] * BinaryPointer), (Stmt[] * BinaryPointer)>

BinHandle.LiftBBlock(hdl, addr)

Full Usage: BinHandle.LiftBBlock(hdl, addr)

Parameters:
Returns: Result<(Stmt[] * Addr), (Stmt[] * Addr)>

Return the lifted IR (an array of statements) of a basic block at the given address. This function returns a partial bblock with Error, if the parsing of the bblock was not successful.

hdl : BinHandle
addr : Addr
Returns: Result<(Stmt[] * Addr), (Stmt[] * Addr)>

BinHandle.LiftInstr(hdl) (ins)

Full Usage: BinHandle.LiftInstr(hdl) (ins)

Parameters:
Returns: Stmt[]

Lift a parsed instruction (Instruction) to produce an array of IR statements from a given BinHandle.

hdl : BinHandle
ins : Instruction
Returns: Stmt[]

BinHandle.LiftOptimizedInstr(hdl) (ins)

Full Usage: BinHandle.LiftOptimizedInstr(hdl) (ins)

Parameters:
Returns: Stmt[]

Lift a parsed instruction (Instruction) to produce an array of optimized IR statements from a given BinHandle.

hdl : BinHandle
ins : Instruction
Returns: Stmt[]

BinHandle.Optimize(stmts)

Full Usage: BinHandle.Optimize(stmts)

Parameters:
Returns: Stmt[]

Return optimized statements from the given statements.

stmts : Stmt[]
Returns: Stmt[]

BinHandle.ParseBBlock(arg1, bp)

Full Usage: BinHandle.ParseBBlock(arg1, bp)

Parameters:
Returns: Result<Instruction list, Instruction list>

Parse a basic block pointed to by the binary pointer (bp), and return the sequence of the instructions of the basic block. This function may return an incomplete basic block as an Error type. This function can be safely used for any ISAs, and thus, this should be the main parsing function.

arg0 : BinHandle
bp : BinaryPointer
Returns: Result<Instruction list, Instruction list>

BinHandle.ParseBBlock(arg1, addr)

Full Usage: BinHandle.ParseBBlock(arg1, addr)

Parameters:
Returns: Result<Instruction list, Instruction list>

Parse a basic block from the given address, and return the sequence of the instructions of the basic block. This function may return an incomplete basic block as an Error type. This function can be safely used for any ISAs, and thus, this should be the main parsing function.

arg0 : BinHandle
addr : Addr
Returns: Result<Instruction list, Instruction list>

BinHandle.ParseInstr(hdl, bp)

Full Usage: BinHandle.ParseInstr(hdl, bp)

Parameters:
Returns: Instruction Parsed instruction.

Parse one instruction pointed to by binary pointer (bp) from the BinHandle, and return the corresponding instruction. This function raises an exception if the parsing process failed.

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

Returns: Instruction

Parsed instruction.

BinHandle.ParseInstr(hdl, addr)

Full Usage: BinHandle.ParseInstr(hdl, addr)

Parameters:
Returns: Instruction Parsed instruction.

Parse one instruction at the given address (addr) from the BinHandle, and return the corresponding instruction. This function raises an exception if the parsing process failed.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

Returns: Instruction

Parsed instruction.

BinHandle.PatchCode(hdl) (addr) (bs)

Full Usage: BinHandle.PatchCode(hdl) (addr) (bs)

Parameters:
    hdl : BinHandle - The BinHandle to update.
    addr : Addr - The new address to use.
    bs : byte[] - The new code in bytes.

Returns: Result<BinHandle, ErrorCase> Return (BinHandle) if succeeded, (ErrorCase) otherwise.

Update BinHandle to patch the code at the address (addr). BinHandle is *immutable*.

hdl : BinHandle

The BinHandle to update.

addr : Addr

The new address to use.

bs : byte[]

The new code in bytes.

Returns: Result<BinHandle, ErrorCase>

Return (BinHandle) if succeeded, (ErrorCase) otherwise.

BinHandle.ReadASCII(hdl, bp)

Full Usage: BinHandle.ReadASCII(hdl, bp)

Parameters:
Returns: string Return the corresponding ASCII string.

Return the ASCII string pointed to by the binary pointer from the given BinHandle.

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

Returns: string

Return the corresponding ASCII string.

BinHandle.ReadASCII(hdl, addr)

Full Usage: BinHandle.ReadASCII(hdl, addr)

Parameters:
Returns: string Return the corresponding ASCII string.

Return the ASCII string at the addr from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

Returns: string

Return the corresponding ASCII string.

BinHandle.ReadBytes(hdl, bp, nBytes)

Full Usage: BinHandle.ReadBytes(hdl, bp, nBytes)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    nBytes : int - The size of the byte array (in bytes).

Returns: byte[] Return the byte array if succeed. Otherwise, raise an exception.

Return the byte array of size (nBytes) from the given BinHandle, which is pointed to by the BinaryPointer (bp).

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

nBytes : int

The size of the byte array (in bytes).

Returns: byte[]

Return the byte array if succeed. Otherwise, raise an exception.

BinHandle.ReadBytes(hdl, addr, nBytes)

Full Usage: BinHandle.ReadBytes(hdl, addr, nBytes)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    nBytes : int - The size of the byte array (in bytes).

Returns: byte[] Return the byte array if succeed. Otherwise, raise an exception.

Return the byte array of size (nBytes) at the addr from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

nBytes : int

The size of the byte array (in bytes).

Returns: byte[]

Return the byte array if succeed. Otherwise, raise an exception.

BinHandle.ReadInt(hdl, bp, size)

Full Usage: BinHandle.ReadInt(hdl, bp, size)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64 Return the corresponding integer (int64).

Return the corresponding integer value of the size from the given BinHandle (hdl), which is pointed to by the binary pointer (bp).

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64

Return the corresponding integer (int64).

BinHandle.ReadInt(hdl, addr, size)

Full Usage: BinHandle.ReadInt(hdl, addr, size)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64 Return the corresponding integer (int64).

Return the corresponding integer value at the addr of the size from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: int64

Return the corresponding integer (int64).

BinHandle.ReadUInt(hdl, bp, size)

Full Usage: BinHandle.ReadUInt(hdl, bp, size)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64 Return the corresponding unsigned integer (uint64).

Return the corresponding unsigned integer value of the size from the given BinHandle (hdl), which is pointed to by the binary pointer (bp).

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64

Return the corresponding unsigned integer (uint64).

BinHandle.ReadUInt(hdl, addr, size)

Full Usage: BinHandle.ReadUInt(hdl, addr, size)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64 Return the corresponding unsigned integer (uint64).

Return the corresponding unsigned integer value at the addr of the size from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: uint64

Return the corresponding unsigned integer (uint64).

BinHandle.TryParseInstr(hdl, bp)

Full Usage: BinHandle.TryParseInstr(hdl, bp)

Parameters:
Returns: Result<Instruction, ErrorCase> Parsed instruction (option type).

Parse one instruction pointed to by the binary pointer (bp) from the BinHandle, and return the corresponding instruction. This function does not raise an exception, but returns an option type.

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

Returns: Result<Instruction, ErrorCase>

Parsed instruction (option type).

BinHandle.TryParseInstr(hdl, addr)

Full Usage: BinHandle.TryParseInstr(hdl, addr)

Parameters:
Returns: Result<Instruction, ErrorCase> Parsed instruction (option type).

Parse one instruction at the given address (addr) from the BinHandle, and return the corresponding instruction. This function does not raise an exception, but returns an option type.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

Returns: Result<Instruction, ErrorCase>

Parsed instruction (option type).

BinHandle.TryReadBytes(hdl, bp, nBytes)

Full Usage: BinHandle.TryReadBytes(hdl, bp, nBytes)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    nBytes : int - The size of the byte array (in bytes).

Returns: Result<byte[], ErrorCase> Return (byte []) if succeeded, (ErrorCase) otherwise.

Return the byte array of size (nBytes) from the BinHandler (hdl), which is pointed to by the BinaryPointer (bp). The return value is an option type. When the given address is invalid, this function returns None.

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

nBytes : int

The size of the byte array (in bytes).

Returns: Result<byte[], ErrorCase>

Return (byte []) if succeeded, (ErrorCase) otherwise.

BinHandle.TryReadBytes(hdl, addr, nBytes)

Full Usage: BinHandle.TryReadBytes(hdl, addr, nBytes)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    nBytes : int - The size of the byte array (in bytes).

Returns: Result<byte[], ErrorCase> Return (byte []) if succeeded, (ErrorCase) otherwise.

Return the byte array of size (nBytes) at the addr from the given BinHandle (hdl). The return value is an option type. When the given address is invalid, this function returns None.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

nBytes : int

The size of the byte array (in bytes).

Returns: Result<byte[], ErrorCase>

Return (byte []) if succeeded, (ErrorCase) otherwise.

BinHandle.TryReadInt(hdl, bp, size)

Full Usage: BinHandle.TryReadInt(hdl, bp, size)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<int64, ErrorCase> Return the corresponding value (int64) if the address and the size is valid. Otherwise ErrorCase.

Return the corresponding integer option value of the size from the given BinHandle (hdl), which is pointed to by the binary pointer (bp).

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<int64, ErrorCase>

Return the corresponding value (int64) if the address and the size is valid. Otherwise ErrorCase.

BinHandle.TryReadInt(hdl, addr, size)

Full Usage: BinHandle.TryReadInt(hdl, addr, size)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<int64, ErrorCase> Return the corresponding value (int64) if the address and the size is valid. Otherwise ErrorCase.

Return the corresponding integer option value at the addr of the size from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<int64, ErrorCase>

Return the corresponding value (int64) if the address and the size is valid. Otherwise ErrorCase.

BinHandle.TryReadUInt(hdl, bp, size)

Full Usage: BinHandle.TryReadUInt(hdl, bp, size)

Parameters:
    hdl : BinHandle - BinHandle.
    bp : BinaryPointer - BinaryPointer.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<uint64, ErrorCase> Return the corresponding unsigned integer (uint64) if the address and the size is valid. Otherwise, ErrorCase.

Return the corresponding unsigned integer option value of the size from the given BinHandle (hdl), which is pointed to by the binary pointer (bp).

hdl : BinHandle

BinHandle.

bp : BinaryPointer

BinaryPointer.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<uint64, ErrorCase>

Return the corresponding unsigned integer (uint64) if the address and the size is valid. Otherwise, ErrorCase.

BinHandle.TryReadUInt(hdl, addr, size)

Full Usage: BinHandle.TryReadUInt(hdl, addr, size)

Parameters:
    hdl : BinHandle - BinHandle.
    addr : Addr - The address.
    size : int - The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<uint64, ErrorCase> Return the corresponding unsigned integer (uint64) if the address and the size is valid. Otherwise, ErrorCase.

Return the corresponding unsigned integer option value at the addr of the size from the given BinHandle.

hdl : BinHandle

BinHandle.

addr : Addr

The address.

size : int

The size of the integer in bytes. Maximum 8 bytes is possible.

Returns: Result<uint64, ErrorCase>

Return the corresponding unsigned integer (uint64) if the address and the size is valid. Otherwise, ErrorCase.

BinHandle.UpdateCode(hdl) (addr) (bs)

Full Usage: BinHandle.UpdateCode(hdl) (addr) (bs)

Parameters:
    hdl : BinHandle - The BinHandle to update.
    addr : Addr - The new address to use.
    bs : byte[] - The new code in bytes.

Returns: BinHandle New BinHandle.

Update BinHandle to have new code at a new address (addr). BinHandle is *immutable*.

hdl : BinHandle

The BinHandle to update.

addr : Addr

The new address to use.

bs : byte[]

The new code in bytes.

Returns: BinHandle

New BinHandle.