ROSE
0.11.66.0
|
Creates and holds the handle for the sqlite database used for storing and matching libraries and functions, FLIRT style.
Definition at line 46 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< FunctionInfo > | matchFunction (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... | |
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.
[in] | dbName | Name of the database to open |
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
[in,out] | fInfo | The FunctionInfo only needs to contain the hash, the rest will be filled in. |
std::vector<FunctionInfo> LibraryIdentification::FunctionIdDatabaseInterface::matchFunction | ( | const FunctionInfo & | fInfo | ) |
Lookup all functions with the hash in the database.
[in,out] | funcInfo | is used as a prototype for all the returned FunctionInfos |
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
[in,out] | fInfo | The FunctionInfo only needs to contain the hash, name, and library hash. There should only be one matching function in the database. |
void LibraryIdentification::FunctionIdDatabaseInterface::removeFunctions | ( | const std::string & | funcHash | ) |
Removes any functions that match the hash from the database.
[in,out] | The | hash to remove from the database |
bool LibraryIdentification::FunctionIdDatabaseInterface::matchLibrary | ( | LibraryInfo & | fInfo | ) |
Lookup a library in the database.
True returned if found
[in,out] | lInfo | The LibraryInfo only needs to contain the hash, the rest will be filled in. |