Public Member Functions

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

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

List of all members.

Public Member Functions

void addListener (final IFunctionListener listener)
List< IComment > appendComment (final String comment) throws CouldntSaveDataException, CouldntLoadDataException
void close ()
void deleteComment (final IComment comment) throws com.google.security.zynamics.binnavi.API.disassembly.CouldntDeleteException
IComment editComment (final IComment comment, final String newComment) throws CouldntSaveDataException
Address getAddress ()
int getBlockCount ()
List< IComment > getComment ()
String getDescription ()
int getEdgeCount ()
FlowGraph getGraph ()
Module getModule ()
String getName ()
ReilFunction getReilCode () throws InternalTranslationException
FunctionType getType ()
boolean isLoaded ()
void load () throws CouldntLoadDataException
void removeListener (final IFunctionListener listener)
void setComment (final ArrayList< IComment > comment) throws CouldntSaveDataException
void setDescription (final String description) throws CouldntSaveDataException
void setName (final String name) throws CouldntSaveDataException
String toString ()

Detailed Description

Function objects describe original functions from imported modules. This includes things like the name or the description of the function as well as the flowgraph of the function.

The structure of functions is immutable. That means the flowgraph of functions can not be modified. To modify the flowgraph of a function it is necessary to convert it to a View first.


Member Function Documentation

void com.google.security.zynamics.binnavi.API.disassembly.Function.addListener ( final IFunctionListener  listener  ) 

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

Parameters:
listener The listener object that is notified about changes in the function.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object is already listening on the function.
List<IComment> com.google.security.zynamics.binnavi.API.disassembly.Function.appendComment ( final String  comment  )  throws CouldntSaveDataException, CouldntLoadDataException

Appends a global function comment to the function.

Parameters:
comment The string of the comment to get appended.
Exceptions:
CouldntSaveDataException if the comment could not be stored in the database.
void com.google.security.zynamics.binnavi.API.disassembly.Function.close (  ) 

Unloads the function.

void com.google.security.zynamics.binnavi.API.disassembly.Function.deleteComment ( final IComment  comment  )  throws com.google.security.zynamics.binnavi.API.disassembly.CouldntDeleteException

Delete a function comment.

Parameters:
comment The IComment to delete.
Exceptions:
com.google.security.zynamics.binnavi.API.disassembly.CouldntDeleteException 
IComment com.google.security.zynamics.binnavi.API.disassembly.Function.editComment ( final IComment  comment,
final String  newComment 
) throws CouldntSaveDataException

Edit a function comment.

Parameters:
comment The IComment which is edited.
newComment The String to replace the current comment text.
Returns:
The edited comment.
Exceptions:
CouldntSaveDataException if the edit operation failed.
Address com.google.security.zynamics.binnavi.API.disassembly.Function.getAddress (  ) 

Returns the start address of the function.

Returns:
The start address of the function.
int com.google.security.zynamics.binnavi.API.disassembly.Function.getBlockCount (  ) 

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

Returns:
The number of basic blocks in the function.
List<IComment> com.google.security.zynamics.binnavi.API.disassembly.Function.getComment (  ) 

Returns the function comment. This is the comment that is shown as the global comment in views that show function nodes.

Returns:
The function comment.
String com.google.security.zynamics.binnavi.API.disassembly.Function.getDescription (  ) 

Returns the description of the function. This is the string that is shown as the description of the function in the main window.

Returns:
The function description.
int com.google.security.zynamics.binnavi.API.disassembly.Function.getEdgeCount (  ) 

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

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

Returns the flowgraph of the function. This graph contains the basic blocks of the function and edges that show how control flow can propagate through the function.

Returns:
The flowgraph of the function.
Exceptions:
IllegalStateException Thrown if the function is not loaded.
Module com.google.security.zynamics.binnavi.API.disassembly.Function.getModule (  ) 

Returns the module the function belongs to.

Returns:
The module the function belongs to.
String com.google.security.zynamics.binnavi.API.disassembly.Function.getName (  ) 

Returns the name of the function.

Returns:
The name of the function.
ReilFunction com.google.security.zynamics.binnavi.API.disassembly.Function.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.
FunctionType com.google.security.zynamics.binnavi.API.disassembly.Function.getType (  ) 

Returns the type of the function.

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

Returns a flag that indicates whether the function is loaded.

Returns:
True, if the function is loaded. False, otherwise.
void com.google.security.zynamics.binnavi.API.disassembly.Function.load (  )  throws CouldntLoadDataException

Loads the function data from the database.

Exceptions:
IllegalStateException Thrown if the function is already loaded.
CouldntLoadDataException Thrown if the function data could not be loaded from the database.
void com.google.security.zynamics.binnavi.API.disassembly.Function.removeListener ( final IFunctionListener  listener  ) 

Removes a listener object from the function.

Parameters:
listener The listener object to remove from the function.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object was not listening on the function.
void com.google.security.zynamics.binnavi.API.disassembly.Function.setComment ( final ArrayList< IComment >  comment  )  throws CouldntSaveDataException

Changes the comment of the function. This is the comment that is shown as the global comment in views that show function nodes.

Parameters:
comment The new value of the comment.
Exceptions:
IllegalArgumentException Thrown if the comment argument is null.
CouldntSaveDataException Thrown if the comment could not be changed.
void com.google.security.zynamics.binnavi.API.disassembly.Function.setDescription ( final String  description  )  throws CouldntSaveDataException

Changes the description of the function.

Parameters:
description The new value of the description.
Exceptions:
IllegalArgumentException Thrown if the description argument is null.
CouldntSaveDataException Thrown if the description could not be changed.
void com.google.security.zynamics.binnavi.API.disassembly.Function.setName ( final String  name  )  throws CouldntSaveDataException

Changes the name of the function.

Parameters:
name The new value of the name.
Exceptions:
IllegalArgumentException Thrown if the name argument is null.
CouldntSaveDataException Thrown if the name could not be changed.
String com.google.security.zynamics.binnavi.API.disassembly.Function.toString (  ) 

Returns the string representation of the function.

Returns:
The string representation of the function.