Header menu logo B2R2

B2R2 Namespace

B2R2 is the top-level namespace, representing the whole project.

Type/Module Description

Addr (Module)

Provides a useful set of functions for handling Addr values.

Addr (Type)

Represents an address in binary code. Technically this is just an alias of uint64.

AddrRange

Represents a range of address values that are greater or equal to the Min value (inclusive) and are less than or equal to the Max value (inclusive).

Agent<'Msg>

Represents an agent that processes messages asynchronously using the TPL Dataflow. See also AgentReplyChannel.

AgentReplyChannel<'Reply>

Represents a reply channel for an agent (Agent). The agent will receive a message synchronously from the reply channel.

Architecture

Represents CPU architecture types that are supported by B2R2.

Attribution

B2R2 project attribution.

BigInteger

Provides functions for dealing with bigint values. See also: Numerics.BigInteger

BitVector

Represents a bit vector, which is a sequence of bits. This type internally uses two different representations to represent a bit vector depending on its size. The numeric value of the bit vector is stored in little-endian order. For those with less than or equal to 64 bits, it uses uint64. For those with more than 64 bits, it uses bigint. This is to avoid the overhead of using bigint for small numbers as most CPU operations are in 64 bits or less. N.B. SmallValue becomes zero when the Length becomes greater than 64. We intentionally do not sync SmallValue and BigValue for performance reasons.

Byte

Provides functions for handling a byte value. See also: System.Byte

ByteArray (Module)

Provides several useful functions to deal with byte arrays (i.e., ByteArray).

ByteArray (Type)

Represents an array of bytes, often used to read raw binary data. This is just an alias for byte[], but we define it here to provide several useful functions to deal with byte arrays in the ByteArray module.

BytePattern (Module)

Provides functions to work with BytePattern. It includes functions to match a byte array or a span against a BytePattern.

BytePattern (Type)

Represents a pattern of bytes that can be used to match a byte array. A BytePattern is an array of ByteValue, where each ByteValue (ByteValue) can be either AnyByte (which matches any byte) or OneByte (which matches a specific byte value). The following pattern matches any byte followed by the byte 0xFF: let pattern = [| AnyByte; OneByte 0xFF |]

ByteValue

Represents a single byte value in a BytePattern. It can be either AnyByte, which matches any byte, or OneByte, which matches a specific byte value.

CallSite

Call site information of an abstract vertex in a control flow graph. Typically, there is a single concrete caller vertex that calls an abstract vertex. But in some cases, such as Continuation-Passing Style (CPS) patterns found in EVM binaries, an abstract vertex can have a chain of callers.

CILKind

Represents the kind of CIL code: only CIL, CIL for x86, or CIL for x64.

Endian (Module)

Provides functions to work with Endian.

Endian (Type)

Represents the endianness used in a binary.

ErrorCase (Module)

Provides functions to work with ErrorCase.

ErrorCase (Type)

Represents common error cases found in B2R2.

HexString

Provides helper functions to construct hexadecimal strings from integers. The hexadecimal string is prefixed with "0x" and is in lowercase. We use these functions to consistently format integer values in hexadecimal representation.

IAgentMessageReceivable<'Msg>

Interface for receiving agent messages.

InvalidAddrRangeException

Raised when an AddrRange has the same Min and Max value, i.e., for invalid interval.

InvalidEndianException

Raised when an invalid Endian value is used.

InvalidISAException

Raised when an invalid ISA is given as a parameter.

InvalidRegTypeException

Raised when an invalid RegType is encountered.

InvalidWordSizeException

Raised when an invalid WordSize is encountered.

ISA (Module)

Provides active patterns for matching against specific ISAs.

ISA (Type)

Represents the Instruction Set Architecture (ISA).

LEB128

Provides functions for encoding/decoding LEB128 integers. LEB128 is a variable-length encoding scheme that is designed to compactly represent integers.

LEB128DecodeException

Raised when LEB128 decoding failed, e.g., when the given input bytes has incorrect encoding.

LinuxSyscall (Module)

Provides functions to convert Linux syscall numbers to their corresponding syscall types and vice versa.

LinuxSyscall (Type)

Represents Linux syscalls.

OS (Module)

Provides functions to work with OS types.

OS (Type)

Represents the target operating system type that the binary is compiled for.

ProgramPoint

Represents a specific location in a lifted program. We represent this as a three-tuple: (address of the instruction, index of the IR stmt for the instruction, call site information). The third element (call site) is optional and only meaningful for abstract vertices.

PythonVersion

Represents the Python version.

RangeOverlapException

Raised when there is an overlapping intervals from the interval tree.

RegisterID (Module)

Provides a function to create a RegisterID. Although it is essentially an integer, we internally use a "unit of measure" to represent it, meaning that one needs to go through this module in order to create a new ID.

RegisterID (Type)

Represents a platform-independent identifier for a register.

RegType (Module)

Provides several helper functions to deal with RegType.

RegType (Type)

Represents a register type in terms of its bit width. We use a unit of measure to represent the bit width of a register. For example, a 32-bit register is represented as 32<rt>, and a 64-bit register is represented as 64<rt>.

String

Provides useful functions for handling string values.

Terminator

Provides a set of terminating functions, which are used to terminate the program when a non-recoverable error is encountered.

UnhandledSyscallException

Raised when unhandled syscall is encountered.

UnknownOSException

Raised when unknown OS type is detected.

WordSize (Module)

Provides helper functions for handling the WordSize type.

WordSize (Type)

Represents the word size of a CPU. The word size is the number of bits that the CPU can naturally process in a single operation.

Type something to start searching.