Public Member Functions

com.google.security.zynamics.binnavi.API.disassembly.View Class Reference

Inherits com::google::security::zynamics::binnavi::APIHelpers::ApiObject< INaviView >.

List of all members.

Public Member Functions

void addListener (final IViewListener listener)
void addTag (final Tag tag) throws CouldntSaveDataException
boolean close ()
CodeNode createCodeNode (final Function function, final List< Instruction > instructions)
ViewEdge createEdge (final ViewNode source, final ViewNode target, final EdgeType edgeType)
FunctionNode createFunctionNode (final Function function)
GroupNode createGroupNode (final String text, final List< ViewNode > elements)
ViewNode createNode (final ViewNode node)
TextNode createTextNode (final ArrayList< IComment > comments)
void deleteEdge (final ViewEdge edge)
void deleteNode (final ViewNode node)
ViewContainer getContainer ()
String getDescription ()
int getEdgeCount ()
ViewGraph getGraph ()
GraphType getGraphType ()
String getName ()
int getNodeCount ()
ReilFunction getReilCode () throws InternalTranslationException
List< TaggetTags ()
ViewType getType ()
boolean isLoaded ()
void load () throws CouldntLoadDataException, PartialLoadException
void removeListener (final IViewListener listener)
void removeTag (final Tag tag) throws CouldntSaveDataException
void save () throws CouldntSaveDataException
void setDescription (final String description) throws CouldntSaveDataException
void setName (final String name) throws CouldntSaveDataException
String toString ()

Detailed Description

Views are arbitrary graphs that can be displayed. In most cases views are either flowgraphs and callgraphs that can be shown in com.google.security.zynamics.binnavi. The nodes of a view are not limited to one kind though. A view can have different kinds of nodes and if you work on the nodes of a view you have to be aware of this.

Common node types are CodeNode objects which are the view equivalent of basic blocks and FunctionNode which are the equivalent of callgraph nodes.


Member Function Documentation

void com.google.security.zynamics.binnavi.API.disassembly.View.addListener ( final IViewListener  listener  ) 

Adds an object that is notified about changes in the view.

Parameters:
listener The listener object that is notified about changes in the view.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object is already listening on the view.
void com.google.security.zynamics.binnavi.API.disassembly.View.addTag ( final Tag  tag  )  throws CouldntSaveDataException

Tags the view with a tag.

Parameters:
tag The tag used to tag the view.
Exceptions:
CouldntSaveDataException Thrown if the tag could not be stored in the database.
boolean com.google.security.zynamics.binnavi.API.disassembly.View.close (  ) 

Closed the view. This operation can be vetoed by other plugins or parts of com.google.security.zynamics.binnavi.

Returns:
True, if the view was closed. False, if the close operation was vetoed.
CodeNode com.google.security.zynamics.binnavi.API.disassembly.View.createCodeNode ( final Function  function,
final List< Instruction instructions 
)

Creates a code node in the view.

Parameters:
function The parent function of the code node. This argument is optional can can be null.
instructions The instructions that should be displayed in the code node.
Returns:
The created code node.
ViewEdge com.google.security.zynamics.binnavi.API.disassembly.View.createEdge ( final ViewNode  source,
final ViewNode  target,
final EdgeType  edgeType 
)

Creates an edge in the view.

Parameters:
source The source node of the edge.
target The target node of the edge.
edgeType The edge type of the edge.
Returns:
The created edge.
FunctionNode com.google.security.zynamics.binnavi.API.disassembly.View.createFunctionNode ( final Function  function  ) 

Creates a function node in the view.

Parameters:
function The function the function node represents.
Returns:
The created function node.
GroupNode com.google.security.zynamics.binnavi.API.disassembly.View.createGroupNode ( final String  text,
final List< ViewNode elements 
)

Creates a new group node in the view.

Parameters:
text Text that is shown when the group node is collapsed.
elements Nodes that belong to the group node.
Returns:
The created group node.
ViewNode com.google.security.zynamics.binnavi.API.disassembly.View.createNode ( final ViewNode  node  ) 

Creates a new view node by cloning an existing view node.

Parameters:
node The node to clone.
Returns:
The cloned node.
TextNode com.google.security.zynamics.binnavi.API.disassembly.View.createTextNode ( final ArrayList< IComment >  comments  ) 

creates a new text node.

Parameters:
comments The list of comments to fill the text node with.
Returns:
The newly generated text node.
void com.google.security.zynamics.binnavi.API.disassembly.View.deleteEdge ( final ViewEdge  edge  ) 

Deletes an edge from the view.

Parameters:
edge The edge to delete.
void com.google.security.zynamics.binnavi.API.disassembly.View.deleteNode ( final ViewNode  node  ) 

Deletes a node from the view.

Parameters:
node The node to delete.
ViewContainer com.google.security.zynamics.binnavi.API.disassembly.View.getContainer (  ) 

Returns the container of the view. This can be either a project or a module.

Returns:
The container of the view.
String com.google.security.zynamics.binnavi.API.disassembly.View.getDescription (  ) 

Returns the description of the view.

Returns:
The description of the view.
int com.google.security.zynamics.binnavi.API.disassembly.View.getEdgeCount (  ) 

Returns the number of edges in the view. This function can be called if the view has not yet been loaded.

Returns:
The number of edges in the view.
ViewGraph com.google.security.zynamics.binnavi.API.disassembly.View.getGraph (  ) 

Returns the graph of the view. This is the visible part of the view that is displayed in the graph windows of com.google.security.zynamics.binnavi.

Returns:
The graph of the view.
Exceptions:
IllegalStateException Thrown if the view is not loaded.
GraphType com.google.security.zynamics.binnavi.API.disassembly.View.getGraphType (  ) 

Returns the type of the view graph. The graph of a view can either be a flowgraph (if all nodes of the graph are of type CodeNode), a callgraph (if all nodes of the graph are of type FunctionNode), or a mixed graph (if the graph contains arbitrarily mixed nodes).

Returns:
The type of the graph.
String com.google.security.zynamics.binnavi.API.disassembly.View.getName (  ) 

Returns the name of the view.

Returns:
The name of the view.
int com.google.security.zynamics.binnavi.API.disassembly.View.getNodeCount (  ) 

Returns the number of nodes in the view. This function can be called if the view has not yet been loaded.

Returns:
The number of nodes in the view.
ReilFunction com.google.security.zynamics.binnavi.API.disassembly.View.getReilCode (  )  throws InternalTranslationException

Converts the View to REIL code. This function can only be used if the view has already been loaded.

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 view provided that nothing relevant (like added/removed code nodes) changed.

Returns:
The REIL representation of the view.
Exceptions:
InternalTranslationException Thrown if the REIL translation failed.
List<Tag> com.google.security.zynamics.binnavi.API.disassembly.View.getTags (  ) 

Returns all tags that are currently associated with the view.

Returns:
The tags of the view.
ViewType com.google.security.zynamics.binnavi.API.disassembly.View.getType (  ) 

Returns the type of the view. A view can be either native (i.e. an immutable view created by the importer) or non-native (i.e. a mutable view created by the user).

Returns:
The type of the view.
boolean com.google.security.zynamics.binnavi.API.disassembly.View.isLoaded (  ) 

Returns a flag that indicates whether the view data has been loaded from the database.

Returns:
True, if the view has been loaded. False, otherwise.
void com.google.security.zynamics.binnavi.API.disassembly.View.load (  )  throws CouldntLoadDataException, PartialLoadException

Loads the view data from the database.

Exceptions:
IllegalStateException Thrown if the view is already loaded.
CouldntLoadDataException Thrown if the data could not be loaded from the database.
PartialLoadException Thrown if the view could not be loaded because not all involved modules could be loaded.
void com.google.security.zynamics.binnavi.API.disassembly.View.removeListener ( final IViewListener  listener  ) 

Removes a listener object from the view.

Parameters:
listener The listener object to remove from the view.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object was not listening on the database.
void com.google.security.zynamics.binnavi.API.disassembly.View.removeTag ( final Tag  tag  )  throws CouldntSaveDataException

Removes a tag from the view.

Parameters:
tag The tag to remove from the view.
Exceptions:
CouldntSaveDataException Thrown if the tag could not be removed from the view.
void com.google.security.zynamics.binnavi.API.disassembly.View.save (  )  throws CouldntSaveDataException

Saves the view to the database. Please note that only non-native views can be saved using this function.

Exceptions:
CouldntSaveDataException Thrown if the view could not be saved.
void com.google.security.zynamics.binnavi.API.disassembly.View.setDescription ( final String  description  )  throws CouldntSaveDataException

Changes the description of the view.

Parameters:
description The new description of the view.
Exceptions:
CouldntSaveDataException Thrown if the new description could not be saved to the database
void com.google.security.zynamics.binnavi.API.disassembly.View.setName ( final String  name  )  throws CouldntSaveDataException

Changes the name of the view.

Parameters:
name The new name of the view.
Exceptions:
CouldntSaveDataException Thrown if the new name could not be saved to the database
String com.google.security.zynamics.binnavi.API.disassembly.View.toString (  ) 

Returns the string representation of the view.

Returns:
The string representation of the view.