Static Public Member Functions

# BinNavi.API.disassembly.ViewGraphHelpers Class Reference

Offers convenience functions for working with view graphs. More...

List of all members.

## Static Public Member Functions
static CodeNode | getCodeNode (final ViewGraph graph, final Address address)
| Finds a code node with a given address.
static CodeNode | getCodeNode (final ViewGraph graph, final long address)
| Finds a code node with given address.
static List< CodeNode > | getCodeNodes (final ViewGraph graph)
| Returns the code nodes of the graph.
static FunctionNode | getFunctionNode (final ViewGraph graph, final String functionName)
| Finds the function node with a given function name.
static List< FunctionNode > | getFunctionNodes (final ViewGraph graph)
| Returns the function nodes of a graph.
static Instruction | getInstruction (final ViewGraph graph, final Address address)
| Finds an instruction with a given address.
static Instruction | getInstruction (final ViewGraph graph, final long address)
| Finds an instruction with a given address.
static InliningResult | inlineFunctionCall (final View view, final CodeNode codeNode, final Instruction instruction, final Function function)
| Inlines a function call into a code node.

## Detailed Description

Offers convenience functions for working with view graphs. 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 CodeNode BinNavi.API.disassembly.ViewGraphHelpers.getCodeNode | ( | final ViewGraph | graph,
|  | final Address | address |
| ) |  |  | `[static]`

Returns the code node of a view graph that starts at a given address. Since addresses do not uniquely identify code nodes it is possible that there is more than one code node with the given address in the graph. In case of multiple code nodes that start at the given address it is undefined exactly which of those code nodes is returned.

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

Parameters:

  | graph | The graph to search through.
  | address | The address to search for.

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

static CodeNode BinNavi.API.disassembly.ViewGraphHelpers.getCodeNode | ( | final ViewGraph | graph,
|  | final long | address |
| ) |  |  | `[static]`

Returns the code node of a view graph that starts at a given address. Since addresses do not uniquely identify code nodes it is possible that there is more than one code node with the given address in the graph. In case of multiple code nodes that start at the given address it is undefined exactly which of those code nodes is returned.

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

Parameters:

  | graph | The graph to search through.
  | address | The address to search for.

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

static List<CodeNode> BinNavi.API.disassembly.ViewGraphHelpers.getCodeNodes | ( | final ViewGraph | graph | ) | `[static]`

Returns a list of all code nodes of a graph.

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

Parameters:

  | graph | The graph to search through.

Returns:
  The code nodes that are part of the graph.

static FunctionNode BinNavi.API.disassembly.ViewGraphHelpers.getFunctionNode | ( | final ViewGraph | graph,
|  | final String | functionName |
| ) |  |  | `[static]`

Returns the function node of a view graph that represents a function of a given name. Since names do not uniquely identify function nodes it is possible that there is more than one function node with the given name in the graph. In case of multiple function nodes with that name it is undefined exactly which of those function nodes is returned.

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

Parameters:

  | graph | The graph to search through.
  | functionName | The name of the function to search for.

Returns:
  The function node that represents a function with the given name or null if there is no such function node.

static List<FunctionNode> BinNavi.API.disassembly.ViewGraphHelpers.getFunctionNodes | ( | final ViewGraph | graph | ) | `[static]`

Returns a list of all function nodes of a graph.

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

Parameters:

  | graph | The graph to search through.

Returns:
  The function nodes that are part of the graph.

static Instruction BinNavi.API.disassembly.ViewGraphHelpers.getInstruction | ( | final ViewGraph | graph,
|  | final Address | address |
| ) |  |  | `[static]`

Returns the instruction of a view graph that starts at a given address. Since addresses do not uniquely identify instructions it is possible that there is more than one instruction with the given address in the graph. In case of multiple instructions that start at the given address it is undefined exactly which of those instructions is returned.

This function is guaranteed to work in O(m + n) where m is the number of nodes in the graph and n is the number of instructions in the graph.

Parameters:

  | graph | The graph to search through.
  | address | The address to search for.

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

static Instruction BinNavi.API.disassembly.ViewGraphHelpers.getInstruction | ( | final ViewGraph | graph,
|  | final long | address |
| ) |  |  | `[static]`

Returns the instruction of a view graph that starts at a given address. Since addresses do not uniquely identify instructions it is possible that there is more than one instruction with the given address in the graph. In case of multiple instructions that start at the given address it is undefined exactly which of those instructions is returned.

This function is guaranteed to work in O(m + n) where m is the number of nodes in the graph and n is the number of instructions in the graph.

Parameters:

  | graph | The graph to search through.
  | address | The address to search for.

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

static InliningResult BinNavi.API.disassembly.ViewGraphHelpers.inlineFunctionCall | ( | final View | view,
|  | final CodeNode | codeNode,
|  | final Instruction | instruction,
|  | final Function | function |
| ) |  |  | `[static]`

Inserts the code nodes of a function into a view and splits an existing code node (if necessary) to call the function.

Parameters:

  | view | The view where the inlining operation takes place.
  | codeNode | The code node that is split.
  | instruction | The sub-function call instruction.
  | function | The function to be inlined.

Returns:
  Gives information about the inlining process.