Public Member Functions

# BinNavi.API.disassembly.CodeNode Class Reference

Represents a view node that shows instructions. More...

Inheritance diagram for BinNavi.API.disassembly.CodeNode:

List of all members.

## Public Member Functions
Instruction | addInstruction (final Instruction instruction)
| Adds an instruction to the code node.
void | addListener (final ICodeNodeListener listener)
| Adds a code node listener.
void | addListener (final IViewNodeListener listener)
| Adds a view node listener.
void | addTag (final Tag tag) throws CouldntSaveDataException
| Tags the node.
Address | getAddress ()
| Start address of the code node.
Color | getBorderColor ()
| The border color of the node.
List< ViewNode > | getChildren ()
| The child nodes of the node.
Color | getColor ()
| The color of the node.
String | getComment ()
| Comment of the code node.
List< ViewEdge > | getIncomingEdges ()
| Returns the incoming edges of the view node.
List< Instruction > | getInstructions ()
| Instructions inside the code node.
List< ViewEdge > | getOutgoingEdges ()
| Returns the outgoing edges of the view node.
GroupNode | getParentGroup ()
| Parent group of the node.
List< ViewNode > | getParents ()
| The parent nodes of the node.
ReilGraph | getReilCode () throws InternalTranslationException
| REIL code of the code node.
List< Tag > | getTags ()
| Returns tags of the node.
double | getX ()
| X-position of the node.
double | getY ()
| Y-position of the node.
boolean | isSelected ()
| Selection state of the node.
boolean | isTagged (final Tag tag)
| Checks if the node is tagged with a given tag.
boolean | isVisible ()
| Visibility state of the node.
void | removeInstruction (final Instruction instruction)
| Removes an instruction from the code node.
void | removeListener (final ICodeNodeListener listener)
| Removes a code node listener.
void | removeListener (final IViewNodeListener listener)
| Removes a view node listener.
void | removeTag (final Tag tag) throws CouldntSaveDataException
| Removes a tag from the node.
void | setBorderColor (final Color color)
| Changes the border color of the node.
void | setColor (final Color color)
| Changes the background color of the node.
void | setInstructionColor (final Instruction instruction, final int level, final Color color)
| Changes the background color of an instruction.
void | setSelected (final boolean selection)
| Changes the selection state of the node.
void | setX (final double newX)
| Changes the X-position of the node.
void | setY (final double newY)
| Changes the Y-position of the node.
String | toString ()
| Printable representation of the code node.

## Detailed Description

A code node is a node that can be part of view graphs. Each code node represents a basic block.

## Member Function Documentation

Instruction BinNavi.API.disassembly.CodeNode.addInstruction | ( | final Instruction | instruction | ) |

Adds an instruction to the code node. The instruction is appended at the end of the code node.

Please note that not the instruction object you pass to the function is added to the code node. Rather, a copy of the passed instruction object is made and added to the code node. This guarantees that each instruction object appears only once in a view.

Parameters:

  | instruction | The instruction to add to the code node.

Returns:
  The instruction object that was really added to the code node.

void BinNavi.API.disassembly.CodeNode.addListener | ( | final ICodeNodeListener | listener | ) |

Adds a listener object that is notified about changes in the code node.

Parameters:

  | listener | The listener that is added to the code node.

void BinNavi.API.disassembly.ViewNode.addListener | ( | final IViewNodeListener | listener | ) | `[inherited]`

Adds a listener object that is notified about changes in the view node.

Parameters:

  | listener | The listener that is added to the view node.

void BinNavi.API.disassembly.ViewNode.addTag | ( | final Tag | tag | ) | throws CouldntSaveDataException `[inherited]`

Tags a node with a given tag.

Parameters:

  | tag | The tag that is added to the node.

Exceptions:

  | CouldntSaveDataException | Thrown if the node could not be tagged.

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

Returns the address of the code node. The address of a code node equals the address of the first instruction of the code node.

Returns:
  The address of the code node.

Color BinNavi.API.disassembly.ViewNode.getBorderColor | ( |  | ) | `[inherited]`

Returns the current border color of the node.

Returns:
  The current border color of the node.

List<ViewNode> BinNavi.API.disassembly.ViewNode.getChildren | ( |  | ) | `[inherited]`

Returns the nodes of the view that are reachable by following the outgoing edges of the view node.

Returns:
  The reachable children of the view node.

Color BinNavi.API.disassembly.ViewNode.getColor | ( |  | ) | `[inherited]`

Returns the current background color of the node.

Returns:
  The current background color of the node.

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

Returns the local comment associated with the code node.

Returns:
  The local comment associated with the code node.

List<ViewEdge> BinNavi.API.disassembly.ViewNode.getIncomingEdges | ( |  | ) | `[inherited]`

Returns the incoming edges of the view node.

Returns:
  The incoming edges of the view node.

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

Returns the instructions of the code node.

Returns:
  The instructions of the code node.

List<ViewEdge> BinNavi.API.disassembly.ViewNode.getOutgoingEdges | ( |  | ) | `[inherited]`

Returns the ougoing edges of the view node.

Returns:
  The outgoing edges of the view node.

GroupNode BinNavi.API.disassembly.ViewNode.getParentGroup | ( |  | ) | `[inherited]`

Returns the group node in which the node is contained. If the node does not belong to any group, the return value of this method is null.

Returns:
  Parent group node of the node or null.

List<ViewNode> BinNavi.API.disassembly.ViewNode.getParents | ( |  | ) | `[inherited]`

Returns the nodes of the view that are reachable by following the incoming edges of the view node.

Returns:
  The reachable parents of the view node.

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

Converts the code node 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 code node 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.

List<Tag> BinNavi.API.disassembly.ViewNode.getTags | ( |  | ) | `[inherited]`

Returns the tags that are currently associated with the node.

Returns:
  A list of tags.

double BinNavi.API.disassembly.ViewNode.getX | ( |  | ) | `[inherited]`

Returns the current X position of the node in the view.

Returns:
  The current X position of the node in the view.

double BinNavi.API.disassembly.ViewNode.getY | ( |  | ) | `[inherited]`

Returns the current Y position of the node in the view.

Returns:
  The current Y position of the node in the view.

boolean BinNavi.API.disassembly.ViewNode.isSelected | ( |  | ) | `[inherited]`

Determines whether the node is selected or not.

Returns:
  True, if the node is selected. False, otherwise.

boolean BinNavi.API.disassembly.ViewNode.isTagged | ( | final Tag | tag | ) | `[inherited]`

Determines whether the node is tagged with a given tag.

Parameters:

  | tag | The tag that is checked.

Returns:
  True, if the node is tagged with the tag. False, otherwise.

Exceptions:

  | IllegalArgumentException | Thrown if the tag argument is null.

boolean BinNavi.API.disassembly.ViewNode.isVisible | ( |  | ) | `[inherited]`

Determines whether the node is visible or not.

Returns:
  True, if the node is visible. False, otherwise.

void BinNavi.API.disassembly.CodeNode.removeInstruction | ( | final Instruction | instruction | ) |

Removes an instruction from the code node.

Parameters:

  | instruction | The instruction to remove from the code node.

void BinNavi.API.disassembly.CodeNode.removeListener | ( | final ICodeNodeListener | listener | ) |

Removes a listener object from the code node.

Parameters:

  | listener | The listener that is removed from the code node.

void BinNavi.API.disassembly.ViewNode.removeListener | ( | final IViewNodeListener | listener | ) | `[inherited]`

Removes a listener object from the view node.

Parameters:

  | listener | The listener object to remove from the node.

void BinNavi.API.disassembly.ViewNode.removeTag | ( | final Tag | tag | ) | throws CouldntSaveDataException `[inherited]`

Removes a tag from the node.

Parameters:

  | tag | The tag to remove from the node.

Exceptions:

  | CouldntSaveDataException | Thrown if the tag could not be removed from the node.

void BinNavi.API.disassembly.ViewNode.setBorderColor | ( | final Color | color | ) | `[inherited]`

Changes the border color of the node.

Parameters:

  | color | The new border color of the node.

void BinNavi.API.disassembly.ViewNode.setColor | ( | final Color | color | ) | `[inherited]`

Changes the background color of the node.

Parameters:

  | color | The new background color of the node.

void BinNavi.API.disassembly.CodeNode.setInstructionColor | ( | final Instruction | instruction,
|  | final int | level,
|  | final Color | color |
| ) |  |  |

Changes the background color of an instruction in the code node.

Parameters:

  | instruction | The instruction whose color is changed.
  | level | Identifies the drawing level. Lower levels are drawn at a higher priority than higher levels. Levels below 1000 are reserved for BinNavi and can not be used.
  | color | The color used to highlight the instruction. If this argument is null, highlighting is cleared.

void BinNavi.API.disassembly.ViewNode.setSelected | ( | final boolean | selection | ) | `[inherited]`

Selects or deselects the node.

Parameters:

  | selection | True to select the node, false to deselect it.

void BinNavi.API.disassembly.ViewNode.setX | ( | final double | newX | ) | `[inherited]`

Changes the X position of the node.

Parameters:

  | newX | The new X position of the node.

void BinNavi.API.disassembly.ViewNode.setY | ( | final double | newY | ) | `[inherited]`

Changes the Y position of the node.

Parameters:

  | newY | The new Y position of the node.

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

Returns a string representation of the code node.

Returns:
  A string representation of the code node.

Reimplemented from BinNavi.API.disassembly.ViewNode.