Public Member Functions

# BinNavi.API.disassembly.BasicBlock Class Reference

Represents basic blocks of flowgraphs. More...

Inherits BinNavi::API::disassembly::IGraphNode< BasicBlock >, and BinNavi::APIHelpers::ApiObject< IBlockNode >.

List of all members.

## Public Member Functions
Address | getAddress ()
| Address of the basic block.
List< BasicBlock > | getChildren ()
| Children of the basic block.
String | getComment ()
| Comment of the basic block.
List< Instruction > | getInstructions ()
| Instructions inside the basic block.
Function | getParentFunction ()
| Function the basic block belongs to.
List< BasicBlock > | getParents ()
| Parent blocks of the basic block.
ReilGraph | getReilCode () throws InternalTranslationException
| REIL code of the basic block.
Iterator< Instruction > | iterator ()
| Iterates over the instructions in the basic block.
String | toString ()
| Printable representation of the basic block.

## Detailed Description

Basic blocks are one of the two elements that can be found in FlowGraph objects.

The structure of basic blocks is immutable. If you want to modify basic blocks it is necessary to convert the function that contains the basic blocks into a View first and to modify the corresponding code nodes in the view.

## Member Function Documentation

Address BinNavi.API.disassembly.BasicBlock.getAddress | ( |  | ) |

Returns the address of the basic block. This address equals the address of the first instruction in the basic block.

Returns:
  The address of the basic block.

List<BasicBlock> BinNavi.API.disassembly.BasicBlock.getChildren | ( |  | ) |

Returns the children of the basic block. The children of a basic block are exactly the basic block where control flow can continue after the last instruction of the basic block was executed.

Returns:
  A list of basic blocks that are child blocks of the basic block.

String BinNavi.API.disassembly.BasicBlock.getComment | ( |  | ) |

Returns the comment of the basic block. This comment is displayed as the global comment of code nodes in views.

Returns:
  The comment of the basic block.

List<Instruction> BinNavi.API.disassembly.BasicBlock.getInstructions | ( |  | ) |

Returns a list of instructions inside the basic block.

Returns:
  The instructions of the basic block.

Function BinNavi.API.disassembly.BasicBlock.getParentFunction | ( |  | ) |

Returns the parent function of the basic block.

Returns:
  The parent function of the basic block.

List<BasicBlock> BinNavi.API.disassembly.BasicBlock.getParents | ( |  | ) |

Returns the parents of the basic block. The parents of the basic block are exactly those basic blocks that can be executed right before the first instruction of the basic block is executed.

Returns:
  A list of basic blocks that are parent blocks of the basic block.

ReilGraph BinNavi.API.disassembly.BasicBlock.getReilCode | ( |  | ) | throws InternalTranslationException

Converts the basic block to REIL code.

Using this function over manual translation via ReilTranslator has the advantage that REIL translation results are automatically cached. Subsequent uses of this function requires no additional re-translation of the basic block provided that nothing relevant (like added/removed code nodes) changed.

Returns:
  The REIL representation of the instruction.

Exceptions:

  | InternalTranslationException | Thrown if the REIL translation failed.

Iterator<Instruction> BinNavi.API.disassembly.BasicBlock.iterator | ( |  | ) |

Can be used to iterate over all instructions in the basic block.

Returns:
  An iterator to iterate over the instructions of the basic block.

String BinNavi.API.disassembly.BasicBlock.toString | ( |  | ) |

Returns a string representation of the basic block.

Returns:
  A string representation of the basic block.