ROSE  0.9.11.56
Public Member Functions | List of all members
LibraryIdentification::FunctionIdDatabaseInterface Class Reference

Description

Creates and holds the handle for the sqlite database used for storing and matching libraries and functions, FLIRT style.

Definition at line 44 of file FunctionIdDatabaseInterface.h.

#include <FunctionIdDatabaseInterface.h>

Public Member Functions

 FunctionIdDatabaseInterface (const std::string &dbName)
 FunctionIdentification. More...
 
void createTables ()
 createTables Make sure that all the tables are defined in the function identification database. More...
 
void addFunctionToDB (const FunctionInfo &fInfo, enum DUPLICATE_OPTION dupOption=COMBINE)
 
bool matchOneFunction (FunctionInfo &fInfo)
 Lookup a single function in the database. More...
 
std::vector< FunctionInfomatchFunction (const FunctionInfo &fInfo)
 Lookup all functions with the hash in the database. More...
 
bool exactMatchFunction (const FunctionInfo &fInfo)
 Exactly lookup a function in the database. More...
 
void removeFunctions (const std::string &funcHash)
 Removes any functions that match the hash from the database. More...
 
void addLibraryToDB (const LibraryInfo &lInfo, bool replace=false)
 
bool matchLibrary (LibraryInfo &fInfo)
 Lookup a library in the database. More...
 

Constructor & Destructor Documentation

LibraryIdentification::FunctionIdDatabaseInterface::FunctionIdDatabaseInterface ( const std::string &  dbName)

FunctionIdentification.

Constructor. Either opens or creates a database with file named dbName. The database should have two tables in it, functions and libraries.

Parameters
[in]dbNameName of the database to open

Member Function Documentation

void LibraryIdentification::FunctionIdDatabaseInterface::createTables ( )

createTables Make sure that all the tables are defined in the function identification database.

The database should have two tables in it, functions and libraries. Functions uniquely identifies functions and the library they belong to. Libraries uniquely identifies libraries, and contains metadata about them.

bool LibraryIdentification::FunctionIdDatabaseInterface::matchOneFunction ( FunctionInfo fInfo)

Lookup a single function in the database.

True returned if found

Parameters
[in,out]fInfoThe FunctionInfo only needs to contain the hash, the rest will be filled in.
Returns
: True if a function was found
std::vector<FunctionInfo> LibraryIdentification::FunctionIdDatabaseInterface::matchFunction ( const FunctionInfo fInfo)

Lookup all functions with the hash in the database.

Parameters
[in,out]funcInfois used as a prototype for all the returned FunctionInfos
Returns
A vector of all found functions
bool LibraryIdentification::FunctionIdDatabaseInterface::exactMatchFunction ( const FunctionInfo fInfo)

Exactly lookup a function in the database.

There should only be one that matches Id, name, and library hash

Parameters
[in,out]fInfoThe FunctionInfo only needs to contain the hash, name, and library hash. There should only be one matching function in the database.
Returns
true if found
void LibraryIdentification::FunctionIdDatabaseInterface::removeFunctions ( const std::string &  funcHash)

Removes any functions that match the hash from the database.

Parameters
[in,out]Thehash to remove from the database
bool LibraryIdentification::FunctionIdDatabaseInterface::matchLibrary ( LibraryInfo fInfo)

Lookup a library in the database.

True returned if found

Parameters
[in,out]lInfoThe LibraryInfo only needs to contain the hash, the rest will be filled in.

The documentation for this class was generated from the following file: