Public Member Functions

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

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

List of all members.

Public Member Functions

void addListener (final IDatabaseListener listener)
void close ()
void connect () throws CouldntLoadDriverException, CouldntConnectException, InvalidDatabaseException, CouldntInitializeDatabaseException, InvalidDatabaseFormatException
Project createProject (final String name) throws CouldntSaveDataException
void deleteModule (final Module module) throws CouldntDeleteException
void deleteProject (final Project project) throws CouldntDeleteException
ResultSet executeQuery (final PreparedStatement statement) throws SQLException
ResultSet executeQuery (final String query) throws SQLException
DebuggerTemplateManager getDebuggerTemplateManager ()
String getDescription ()
String getDriver ()
String getHost ()
List< ModulegetModules ()
String getName ()
TagManager getNodeTagManager ()
String getPassword ()
List< ProjectgetProjects ()
String getUrl ()
String getUser ()
TagManager getViewTagManager ()
void importIDB (final String idbfile) throws ImportFailedException
boolean isAutoConnect ()
boolean isConnected ()
boolean isLoaded ()
boolean isSavePassword ()
void load () throws CouldntLoadDataException, InvalidDatabaseVersionException
void refresh () throws CouldntLoadDataException
void removeListener (final IDatabaseListener listener)
void setAutoConnect (final boolean autoConnect)
void setDescription (final String description)
void setDriver (final String driver)
void setHost (final String host)
void setName (final String name)
void setPassword (final String password)
void setSavePassword (final boolean savePassword)
void setUser (final String user)
String toString ()

Detailed Description

Database objects provide configurations for individual databases and - once loaded - access to the projects, modules, and other objects stored in that database.

To use database objects it is important to understand the lifecycle of database objects. After the creation of a database object you have to connect to the database first. Once the connection is established it is possible to load the data from the database. If loading was successful you have full access to the projects, modules, and other objects stored in the database.


Member Function Documentation

void com.google.security.zynamics.binnavi.API.disassembly.Database.addListener ( final IDatabaseListener  listener  ) 

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

Parameters:
listener The listener object that is notified about changes in the database.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object is already listening on the database.
void com.google.security.zynamics.binnavi.API.disassembly.Database.close (  ) 

Closes the database.

void com.google.security.zynamics.binnavi.API.disassembly.Database.connect (  )  throws CouldntLoadDriverException, CouldntConnectException, InvalidDatabaseException, CouldntInitializeDatabaseException, InvalidDatabaseFormatException

Opens a connection to the database.

Exceptions:
CouldntLoadDriverException Thrown if the driver to be used to connect to the database could not be loaded.
CouldntConnectException Thrown if no connection to the database could be established.
InvalidDatabaseException Thrown if the database is in an inconsistent state and can not be used.
CouldntInitializeDatabaseException Thrown if the database could not be initialized for use with com.google.security.zynamics.binnavi.
InvalidDatabaseFormatException Thrown if the database is not a BinNavi 3.0 database.
Project com.google.security.zynamics.binnavi.API.disassembly.Database.createProject ( final String  name  )  throws CouldntSaveDataException

Creates a new project in the database. The created project is immediately stored in the database. Further save operations are not necessary.

Parameters:
name The name of the new project
Returns:
The newly created project.
Exceptions:
IllegalArgumentException Thrown if the name argument is null.
IllegalStateException Thrown if there is no connection to the database or the database is not loaded.
CouldntSaveDataException Thrown if the project could not be created.
void com.google.security.zynamics.binnavi.API.disassembly.Database.deleteModule ( final Module  module  )  throws CouldntDeleteException

Deletes a module from the database.

Parameters:
module The module to delete from the database.
Exceptions:
CouldntDeleteException Thrown if the module could not be deleted from the database.
void com.google.security.zynamics.binnavi.API.disassembly.Database.deleteProject ( final Project  project  )  throws CouldntDeleteException

Deletes a project from the database.

Parameters:
project The project to delete from the database.
Exceptions:
CouldntDeleteException Thrown if the project could not be deleted from the database.
ResultSet com.google.security.zynamics.binnavi.API.disassembly.Database.executeQuery ( final PreparedStatement  statement  )  throws SQLException

Executes a raw SQL query on the database and returns the result set of the query.

Parameters:
statement The SQL query to issue.
Returns:
The results of the query. Plugins using this method have to close this result set themselves when they are done.
Exceptions:
SQLException Thrown if the query failed for whatever reason.
ResultSet com.google.security.zynamics.binnavi.API.disassembly.Database.executeQuery ( final String  query  )  throws SQLException

Executes a raw SQL query on the database and returns the result set of the query.

Parameters:
query The query to issue.
Returns:
The results of the query. Plugins using this method have to close this result set themselves when they are done.
Exceptions:
SQLException Thrown if the query failed for whatever reason.
DebuggerTemplateManager com.google.security.zynamics.binnavi.API.disassembly.Database.getDebuggerTemplateManager (  ) 

Returns the debugger template manager of this database. This is the manager that keeps track of all pre-defined debugger templates.

Returns:
The debugger template manager of this database.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getDescription (  ) 

Returns the description of the database. The description of the database is the text string that is shown in the database node in the project tree.

Returns:
The description of the database.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getDriver (  ) 

Returns the name of the driver that is used to connect to this database.

Returns:
The driver of the database.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getHost (  ) 

Returns the host of the database.

Returns:
The host of the database.
List<Module> com.google.security.zynamics.binnavi.API.disassembly.Database.getModules (  ) 

Returns a list of modules that can be found in the database.

Returns:
A list of modules.
Exceptions:
IllegalStateException Thrown if the database was not loaded before.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getName (  ) 

Returns the name of the database as it is known to the database server.

Returns:
The name of the database.
TagManager com.google.security.zynamics.binnavi.API.disassembly.Database.getNodeTagManager (  ) 

Returns the node tag manager that manages all tags contained in the database.

Returns:
The node tag manager of the database.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getPassword (  ) 

Returns the password string that is used to connect to the database.

Returns:
The password string.
List<Project> com.google.security.zynamics.binnavi.API.disassembly.Database.getProjects (  ) 

Returns a list of projects that can be found in the database.

Returns:
A list of projects.
Exceptions:
IllegalStateException Thrown if the database was not loaded before.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getUrl (  ) 

Returns the URL that describes the location of the database.

Returns:
The URL of the database.
String com.google.security.zynamics.binnavi.API.disassembly.Database.getUser (  ) 

Returns the user that is used to connect to the database.

Returns:
The user string.
TagManager com.google.security.zynamics.binnavi.API.disassembly.Database.getViewTagManager (  ) 

Returns the view tag manager that manages all tags contained in the database.

Returns:
The view tag manager of the database.
void com.google.security.zynamics.binnavi.API.disassembly.Database.importIDB ( final String  idbfile  )  throws ImportFailedException

Imports an IDB file.

Parameters:
idbfile The location of the IDB file to import.
Exceptions:
ImportFailedException Thrown if the IDB file could not be imported.
boolean com.google.security.zynamics.binnavi.API.disassembly.Database.isAutoConnect (  ) 

Returns a flag that indicates whether a connection to the database is established automatically when BinNavi is started.

Returns:
True, if a connection to the database is established automatically. False, otherwise.
boolean com.google.security.zynamics.binnavi.API.disassembly.Database.isConnected (  ) 

Returns a flag that indicates whether a connection to the database is currently open.

Returns:
True, if a connection to the database is open. False, otherwise.
boolean com.google.security.zynamics.binnavi.API.disassembly.Database.isLoaded (  ) 

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

Returns:
True, if the database has been loaded. False, otherwise.
boolean com.google.security.zynamics.binnavi.API.disassembly.Database.isSavePassword (  ) 

Returns a flag that indicates whether the password of this database configuration is stored in the configuration file when BinNavi exits.

Returns:
True, if the password is saved to configuration file. False, otherwise.
void com.google.security.zynamics.binnavi.API.disassembly.Database.load (  )  throws CouldntLoadDataException, InvalidDatabaseVersionException

Loads the data from the database.

Note that a connection to the database must be open before this function can succeed.

Exceptions:
IllegalStateException Thrown if no connection to the database is open.
CouldntLoadDataException Thrown if the data could not be loaded from the database.
InvalidDatabaseVersionException Thrown if the BinNavi tables in the database are not compatible with the used version of com.google.security.zynamics.binnavi.
void com.google.security.zynamics.binnavi.API.disassembly.Database.refresh (  )  throws CouldntLoadDataException

Refreshes the list of modules from the database. This is useful to call if you suspect that the modules stored in the database changed.

Exceptions:
CouldntLoadDataException Thrown if the modules could not reloaded.
void com.google.security.zynamics.binnavi.API.disassembly.Database.removeListener ( final IDatabaseListener  listener  ) 

Removes a listener object from the database.

Parameters:
listener The listener object to remove from the database.
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.Database.setAutoConnect ( final boolean  autoConnect  ) 

Changes the auto-connect flag of the database that is responsible for loading the content of databases automatically when BinNavi is started.

Parameters:
autoConnect True, to automatically load this database when BinNavi is started. False, otherwise.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setDescription ( final String  description  ) 

Changes the description of the database. The description string of a database is the string that is displayed in the database node of the project tree.

Parameters:
description The new description of the database.
Exceptions:
IllegalArgumentException Thrown if the description argument is null.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setDriver ( final String  driver  ) 

Changes the driver string of the database.

Parameters:
driver The new driver string of the database.
Exceptions:
IllegalArgumentException Thrown if the driver argument is null.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setHost ( final String  host  ) 

Changes the host string of the database.

Parameters:
host The new host string of the database.
Exceptions:
IllegalArgumentException Thrown if the host argument is null.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setName ( final String  name  ) 

Changes the name string of the database.

Parameters:
name The new name string of the database.
Exceptions:
IllegalArgumentException Thrown if the name argument is null.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setPassword ( final String  password  ) 

Changes the password that is used to connect to the database.

Parameters:
password The new password.
Exceptions:
IllegalArgumentException Thrown if the password argument is null.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setSavePassword ( final boolean  savePassword  ) 

Changes the save-password flag of the database that is responsible for storing the password to this database in the BinNavi configuration file.

Parameters:
savePassword True, to store the password. False, otherwise.
void com.google.security.zynamics.binnavi.API.disassembly.Database.setUser ( final String  user  ) 

Changes the user that is used to connect to the database.

Parameters:
user The new user string.
Exceptions:
IllegalArgumentException Thrown if the user argument is null.
String com.google.security.zynamics.binnavi.API.disassembly.Database.toString (  ) 

Returns the string representation of the database.

Returns:
The string representation of the database.