Header menu logo B2R2

Addr Module

Provides a useful set of functions for handling Addr values.

Functions and values

Function or value Description

Addr.ofFuncName name

Full Usage: Addr.ofFuncName name

Parameters:
    name : string

Returns: uint64

Converts a function name used in B2R2 to an address (Addr). This function assumes that the given string follows our function naming convention.

name : string
Returns: uint64

Addr.toFuncName addr

Full Usage: Addr.toFuncName addr

Parameters:
Returns: string

Converts an address (Addr) to a function name, which starts with the func_ prefix. This is used to provide consistent names for functions when symbols are not available. The address part is zero-padded to at least 8 hex digits, e.g., func_00401000.

addr : Addr
Returns: string

Addr.toString wordSize addr

Full Usage: Addr.toString wordSize addr

Parameters:
    wordSize : WordSize - The word size of the target architecture.
    addr : Addr - The address to convert.

Returns: string A zero-padded lowercase hex string without a "0x" prefix. 8 digits for 32-bit word size, 16 digits for 64-bit.

Converts an address (Addr) of a given word size (WordSize) to a string.

wordSize : WordSize

The word size of the target architecture.

addr : Addr

The address to convert.

Returns: string

A zero-padded lowercase hex string without a "0x" prefix. 8 digits for 32-bit word size, 16 digits for 64-bit.

Type something to start searching.