ROSE  0.9.10.89
Namespaces | Classes | Functions
Rose::BinaryAnalysis::Partitioner2::ModulesElf Namespace Reference

Description

Disassembly and partitioning utility functions for ELF.

Namespaces

 FixUndefinedSymbols
 Boolean flag for tryLink.
 

Classes

struct  PltEntryMatcher
 Matches an ELF PLT entry. More...
 

Functions

bool isImport (const Partitioner &, const Function::Ptr &)
 True if the function is an import. More...
 
bool isLinkedImport (const Partitioner &, const Function::Ptr &)
 True if function is a linked import. More...
 
bool isUnlinkedImport (const Partitioner &, const Function::Ptr &)
 True if function is a non-linked import. More...
 
bool isObjectFile (const boost::filesystem::path &)
 True if named file is an ELF object file. More...
 
bool isStaticArchive (const boost::filesystem::path &)
 True if named file is a static library archive. More...
 
bool tryLink (const std::string &command, std::string outputName, std::vector< std::string > inputNames, Sawyer::Message::Stream &errors, FixUndefinedSymbols::Boolean fixUndefinedSymbols=FixUndefinedSymbols::YES)
 Try to run a link command. More...
 
void buildMayReturnLists (Partitioner &)
 Build may-return white and black lists. More...
 
std::vector< Function::PtrfindErrorHandlingFunctions (SgAsmElfFileHeader *)
 Reads ELF .eh_frames to find function entry addresses. More...
 
std::vector< Function::PtrfindErrorHandlingFunctions (SgAsmInterpretation *)
 Reads ELF .eh_frames to find function entry addresses. More...
 
size_t findErrorHandlingFunctions (SgAsmElfFileHeader *, std::vector< Function::Ptr > &)
 Reads ELF .eh_frames to find function entry addresses. More...
 
std::vector< Function::PtrfindPltFunctions (const Partitioner &, SgAsmElfFileHeader *)
 Reads ELF PLT sections and returns a list of functions.
 
std::vector< Function::PtrfindPltFunctions (const Partitioner &, SgAsmInterpretation *)
 Reads ELF PLT sections and returns a list of functions.
 
size_t findPltFunctions (const Partitioner &, SgAsmElfFileHeader *, std::vector< Function::Ptr > &)
 Reads ELF PLT sections and returns a list of functions.
 

Function Documentation

std::vector<Function::Ptr> Rose::BinaryAnalysis::Partitioner2::ModulesElf::findErrorHandlingFunctions ( SgAsmElfFileHeader )

Reads ELF .eh_frames to find function entry addresses.

Performs an AST traversal rooted at the specified ast to find ELF .eh_frames sections and returns a sorted list of functions at unique starting addresses. The functions are not attached to the CFG/AUM.

std::vector<Function::Ptr> Rose::BinaryAnalysis::Partitioner2::ModulesElf::findErrorHandlingFunctions ( SgAsmInterpretation )

Reads ELF .eh_frames to find function entry addresses.

Performs an AST traversal rooted at the specified ast to find ELF .eh_frames sections and returns a sorted list of functions at unique starting addresses. The functions are not attached to the CFG/AUM.

size_t Rose::BinaryAnalysis::Partitioner2::ModulesElf::findErrorHandlingFunctions ( SgAsmElfFileHeader ,
std::vector< Function::Ptr > &   
)

Reads ELF .eh_frames to find function entry addresses.

Performs an AST traversal rooted at the specified ast to find ELF .eh_frames sections and returns a sorted list of functions at unique starting addresses. The functions are not attached to the CFG/AUM.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::isImport ( const Partitioner ,
const Function::Ptr  
)

True if the function is an import.

True if the specified function is an import, whether it's actually been linked in or not. This is a weaker version of isLinkedImport.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::isLinkedImport ( const Partitioner ,
const Function::Ptr  
)

True if function is a linked import.

Returns true if the specified function is an import which has been linked to an actual function. This is a stronger version of isImport.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::isUnlinkedImport ( const Partitioner ,
const Function::Ptr  
)

True if function is a non-linked import.

Returns true if the specified function is an import function but has not been linked in yet.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::isObjectFile ( const boost::filesystem::path &  )

True if named file is an ELF object file.

Object files usually have names with a ".o" extension, although this function actually tries to open the file and parse some ELF data structures to make that determination.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::isStaticArchive ( const boost::filesystem::path &  )

True if named file is a static library archive.

Archives usually have names ending with a ".a" extension, although this function actually tries to open the file and parse the header to make that determination.

bool Rose::BinaryAnalysis::Partitioner2::ModulesElf::tryLink ( const std::string &  command,
std::string  outputName,
std::vector< std::string >  inputNames,
Sawyer::Message::Stream errors,
FixUndefinedSymbols::Boolean  fixUndefinedSymbols = FixUndefinedSymbols::YES 
)

Try to run a link command.

The substring "%o" is replaced by the quoted output name, and the substring "%f" is replaced by the space separated list of quoted input names. Bourne shell escape syntax is used. Returns true if the link command was successful, false otherwise.

void Rose::BinaryAnalysis::Partitioner2::ModulesElf::buildMayReturnLists ( Partitioner )

Build may-return white and black lists.