Static Public Member Functions

# BinNavi.API.disassembly.ModuleHelpers Class Reference

Convenience functions for working with modules. More...

List of all members.

## Static Public Member Functions
static Set< Address > | getBasicBlockAddresses (final Module module) throws CouldntLoadDataException
static Function | getFunction (final Module module, final String name)
| Finds the function with a given name.
static Function | getFunction (final Module module, final long address)
| Finds the function that starts at the given address.
static Function | getFunction (final Module module, final Address address)
| Finds the function that starts at a given address.

## Detailed Description

Offers convenience functions for working with modules. Please note that many convenience functions are just straight-forward implementations of commonly used algorithms and therefore can have significant runtime costs.

## Member Function Documentation

static Set<Address> BinNavi.API.disassembly.ModuleHelpers.getBasicBlockAddresses | ( | final Module | module | ) | throws CouldntLoadDataException `[static]`

Returns the start addresses of all basic blocks of a module. This function is probably the fastest way for retrieving the basic block addresses of a module.

Parameters:

  | module | The module whose basic block addresses are returned.

Returns:
  A set that contains all basic block addresses of the module.

Exceptions:

  | CouldntLoadDataException | Thrown if the basic block addresses could not be determined.

static Function BinNavi.API.disassembly.ModuleHelpers.getFunction | ( | final Module | module,
|  | final String | name |
| ) |  |  | `[static]`

Returns the function of a module that has a given name. Please note that function names are not unique and in case of more than one function with the given name it is undefined exactly which of those functions is returned.

This function is guaranteed to work in O(n) where n is the number of functions of the module.

Parameters:

  | module | The module that contains all functions.
  | name | The name of the function to search for.

Returns:
  The function that has the given name or null if there is no such function.

static Function BinNavi.API.disassembly.ModuleHelpers.getFunction | ( | final Module | module,
|  | final long | address |
| ) |  |  | `[static]`

Returns the function of a module that starts at a given address.

This function is guaranteed to work in O(n) where n is the number of functions of the module.

Parameters:

  | module | The module that contains all functions.
  | address | The address of the function to search for.

Returns:
  The function that starts at the given address or null if there is no such function.

static Function BinNavi.API.disassembly.ModuleHelpers.getFunction | ( | final Module | module,
|  | final Address | address |
| ) |  |  | `[static]`

Returns the function of a module that starts at a given address.

This function is guaranteed to work in O(n) where n is the number of functions of the module.

Parameters:

  | module | The module that contains all functions.
  | address | The address of the function to search for.

Returns:
  The function that starts at the given address or null if there is no such function.