ROSE  0.9.10.91
Classes | Typedefs | Functions
LibraryIdentification Namespace Reference

Description

LibraryIdentification.

This namespace encapsulates function for FLIRT ( Fast Library Identification and Recognition Technology) like functionality for ROSE binary analysis.

This namespace encapsulates function for FLIRT ( Fast Library Identification and Recognition Technology) like functionality for ROSE binary analysis. Currently only uses the Fowler-Noll-Vo HasherFnv class in Combinatorics.h. We should add options for others.

This namespace encapsulates library for FLIRT ( Fast Library Identification and Recognition Technology) like libraryality for ROSE binary analysis. Currently only uses the Fowler-Noll-Vo HasherFnv class in Combinatorics.h. We should add options for others.

Classes

class  FunctionIdDatabaseInterface
 Creates and holds the handle for the sqlite database used for storing and matching libraries and functions, FLIRT style. More...
 
class  FunctionInfo
 class FunctionInfo Combines all the information to uniquely identify a single function in one object. More...
 
class  LibraryInfo
 

Typedefs

typedef std::map< LibraryInfo, std::set< FunctionInfo > > LibToFuncsMap
 typedef libToFuncMap This is used as the type to list which functions are found in which libraries from matchLibraryIdentificationDataBase. More...
 

Functions

void generateLibraryIdentificationDataBase (const std::string &databaseName, const std::string &libraryName, const std::string &libraryVersion, SgProject *project, bool replace=false)
 generate Library Identification Database This function takes a binary project (presumeably a library) and hashes every function, in it. More...
 
LibToFuncsMap matchLibraryIdentificationDataBase (const std::string &databaseName, SgProject *project)
 match functions in project to Library Identification Database This is a function to simplify matching functions in a binary project to library functions in the database. More...
 
void insertFunctionToMap (LibToFuncsMap &libToFuncsMap, const LibraryInfo &libraryInfo, const FunctionInfo &functionInfo)
 Private helper function for adding idents to the libToFuncsMap. More...
 

Typedef Documentation

typedef libToFuncMap This is used as the type to list which functions are found in which libraries from matchLibraryIdentificationDataBase.

The map is: libraryname -> set<functions matched in that library>

Functions that are not found in any library, will be placed in the "UNKNOWN" bin.

Definition at line 25 of file libraryIdentification.h.

Function Documentation

void LibraryIdentification::generateLibraryIdentificationDataBase ( const std::string &  databaseName,
const std::string &  libraryName,
const std::string &  libraryVersion,
SgProject project,
bool  replace = false 
)

generate Library Identification Database This function takes a binary project (presumeably a library) and hashes every function, in it.

It then inserts the library and functions into a new sqlite3 database. If the project was built with debug information, we should have a database that can later identify functions in stripped libraries.

Parameters
[in]databaseNameFilename of the database to create/access
[in]libraryNameLibrary names cannot be discovered from all library types, so pass in name.
[in]libraryVersionLibrary version, same problem
[in]projectRose SgProject that has the functions to write or find
[in]replaceIf a function or library already exisits in the database, replace it?
LibToFuncsMap LibraryIdentification::matchLibraryIdentificationDataBase ( const std::string &  databaseName,
SgProject project 
)

match functions in project to Library Identification Database This is a function to simplify matching functions in a binary project to library functions in the database.

It will attempt to match every function defined in the project to a library function.

It returns a LibToFuncsMap that contains every function defined in the project in the following form: Library->set(Function). Functions that could not be matched in the database are found in the "UNKNOWN" library.

Parameters
[in]databaseNameFilename of the database to create/access
[in]projectRose SgProject that has the functions to write or find
Returns
libToFuncsMap Libraries->set(Functions) unmatched functions under "UNKNOWN"
void LibraryIdentification::insertFunctionToMap ( LibToFuncsMap libToFuncsMap,
const LibraryInfo libraryInfo,
const FunctionInfo functionInfo 
)

Private helper function for adding idents to the libToFuncsMap.

Parameters
[in,out]libToFuncsMapThe map to insert to
[in]libraryInfoThis libraryInfo to insert as key
[in]functionInfoThe functionInfo to insert as value