retdec
Public Member Functions | Private Attributes | List of all members
retdec::cpdetect::ElfHeuristics Class Reference

#include <elf_heuristics.h>

Inheritance diagram for retdec::cpdetect::ElfHeuristics:
Inheritance graph
[legend]
Collaboration diagram for retdec::cpdetect::ElfHeuristics:
Collaboration graph
[legend]

Public Member Functions

 ElfHeuristics (retdec::fileformat::ElfFormat &parser, Search &searcher, ToolInformation &toolInfo)
 
- Public Member Functions inherited from retdec::cpdetect::Heuristics
 Heuristics (retdec::fileformat::FileFormat &parser, Search &searcher, ToolInformation &toolInfo)
 
virtual ~Heuristics ()=default
 
void getAllHeuristics ()
 

Protected Member Functions

Virtual methods
virtual void getFormatSpecificCompilerHeuristics () override
 
- Protected Member Functions inherited from retdec::cpdetect::Heuristics
std::string getUpxVersion ()
 
const DetectResultisDetected (const std::string &name, const DetectionStrength minStrength=DetectionStrength::LOW)
 
virtual void getFormatSpecificLanguageHeuristics ()
 
void addCompiler (DetectionMethod source, DetectionStrength strength, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addLinker (DetectionMethod source, DetectionStrength strength, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addInstaller (DetectionMethod source, DetectionStrength strength, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addPacker (DetectionMethod source, DetectionStrength strength, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addCompiler (std::size_t matchNibbles, std::size_t totalNibbles, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addPacker (std::size_t matchNibbles, std::size_t totalNibbles, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addLanguage (const std::string &name, const std::string &extraInfo="", bool isBytecode=false)
 
void addPriorityLanguage (const std::string &name, const std::string &extraInfo="", bool isBytecode=false)
 
std::size_t findSectionName (const std::string &sectionName) const
 
std::size_t findSectionNameStart (const std::string &sectionName) const
 

Private Member Functions

Detection methods
void getUpxHeuristics ()
 
void getNoteHeuristics ()
 
void getBorlandKylixHeuristics ()
 
void getDynamicEntriesHeuristics ()
 

Private Attributes

retdec::fileformat::ElfFormatelfParser
 parser of input ELF file More...
 

Additional Inherited Members

- Protected Attributes inherited from retdec::cpdetect::Heuristics
retdec::fileformat::FileFormatfileParser
 input file parser More...
 
Searchsearch
 signature search engine More...
 
bool canSearch
 true if we can use search engine More...
 
ToolInformationtoolInfo
 results - detected tools More...
 
std::vector< const retdec::fileformat::Section * > sections
 section information More...
 
std::map< std::string, std::size_t > sectionNameMap
 section name counts More...
 
std::size_t noOfSections
 section count More...
 
bool priorityLanguageIsSet = false
 

Detailed Description

ELF-specific heuristics

Constructor & Destructor Documentation

◆ ElfHeuristics()

retdec::cpdetect::ElfHeuristics::ElfHeuristics ( retdec::fileformat::ElfFormat parser,
Search searcher,
ToolInformation toolInfo 
)

Constructor

Parameters
parserParser of input file
searcherSignature search engine
toolInfoStructure for information about detected tools

Member Function Documentation

◆ getBorlandKylixHeuristics()

void retdec::cpdetect::ElfHeuristics::getBorlandKylixHeuristics ( )
private

Try to detect Borland Kylix

◆ getDynamicEntriesHeuristics()

void retdec::cpdetect::ElfHeuristics::getDynamicEntriesHeuristics ( )
private

Try to detect used languages from dynamic records

◆ getFormatSpecificCompilerHeuristics()

void retdec::cpdetect::ElfHeuristics::getFormatSpecificCompilerHeuristics ( )
overrideprotectedvirtual

Get all compiler heuristics which are specific for one file format

Reimplemented from retdec::cpdetect::Heuristics.

◆ getNoteHeuristics()

void retdec::cpdetect::ElfHeuristics::getNoteHeuristics ( )
private

Try to detect tools from note section

◆ getUpxHeuristics()

void retdec::cpdetect::ElfHeuristics::getUpxHeuristics ( )
private

Try to detect UPX

Member Data Documentation

◆ elfParser

retdec::fileformat::ElfFormat& retdec::cpdetect::ElfHeuristics::elfParser
private

parser of input ELF file


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