retdec
Public Member Functions | Private Attributes | List of all members
retdec::common::ToolInfo Class Reference

#include <tool_info.h>

Collaboration diagram for retdec::common::ToolInfo:
Collaboration graph
[legend]

Public Member Functions

bool operator== (const ToolInfo &val) const
 
Tool query methods.
bool isUnknown () const
 
bool isKnown () const
 
bool isBorland () const
 
bool isGcc () const
 
bool isIntel () const
 
bool isOpenWatcom () const
 
bool isMsvc (const std::string &version="") const
 
bool isTool (const std::string &n) const
 
bool isToolVersion (const std::string &v) const
 
bool isCompiler () const
 
bool isLinker () const
 
bool isInstaller () const
 
bool isPacker () const
 
bool isUnknownType () const
 
bool isKnownType () const
 
Tool set methods.
void setType (const std::string &t)
 
void setName (const std::string &n)
 
void setVersion (const std::string &n)
 
void setMajorVersion (unsigned int v)
 
void setMinorVersion (unsigned int v)
 
void setPatchVersion (unsigned int v)
 
void setAdditionalInfo (const std::string &i)
 
void setPercentage (double p)
 
void setIdenticalSignificantNibbles (unsigned i)
 
void setTotalSignificantNibbles (unsigned i)
 
void setIsFromHeuristics (bool h)
 
void setIsUnknown ()
 
void setIsBorland ()
 
void setIsGcc ()
 
void setIsIntel ()
 
void setIsOpenWatcom ()
 
void setIsVisualStudio ()
 
Tool get methods.
std::string getType () const
 
std::string getName () const
 
std::string getVersion () const
 
std::string getAdditionalInfo () const
 
unsigned int getMajorVersion () const
 
unsigned int getMinorVersion () const
 
unsigned int getPatchVersion () const
 
double getPercentage () const
 
unsigned getIdenticalSignificantNibbles () const
 
unsigned getTotalSignificantNibbles () const
 
bool isFromHeuristics () const
 

Private Attributes

std::string _type
 
std::string _name
 
std::string _additionalInfo
 
std::string _version
 
unsigned int _majorVersion = 0
 
unsigned int _minorVersion = 0
 
unsigned int _patchVersion = 0
 
double _percentage = 0.0
 
unsigned _totalSignificantNibbles = 0
 
unsigned _identicalSignificantNibbles = 0
 Number of significant nibbles that were actually found. More...
 
bool _heuristics = false
 Were heuristics used to detect usage of this tool? More...
 

Detailed Description

Represents tools used to create/manipulate input binary (i.e compiler, packer).

Member Function Documentation

◆ getAdditionalInfo()

std::string retdec::common::ToolInfo::getAdditionalInfo ( ) const

◆ getIdenticalSignificantNibbles()

unsigned retdec::common::ToolInfo::getIdenticalSignificantNibbles ( ) const
Returns
Number of significant nibbles that were actually found.

◆ getMajorVersion()

unsigned int retdec::common::ToolInfo::getMajorVersion ( ) const

◆ getMinorVersion()

unsigned int retdec::common::ToolInfo::getMinorVersion ( ) const

◆ getName()

std::string retdec::common::ToolInfo::getName ( ) const

◆ getPatchVersion()

unsigned int retdec::common::ToolInfo::getPatchVersion ( ) const

◆ getPercentage()

double retdec::common::ToolInfo::getPercentage ( ) const
Returns
Probability that the tool was actually used. This does not have to be set. It is significant only if the value is not 0.0.

◆ getTotalSignificantNibbles()

unsigned retdec::common::ToolInfo::getTotalSignificantNibbles ( ) const
Returns
Total number of significant nibbles in signature recognizing this tool.

◆ getType()

std::string retdec::common::ToolInfo::getType ( ) const

◆ getVersion()

std::string retdec::common::ToolInfo::getVersion ( ) const
Returns
Returns version string if it was set by setVersion(). Otherwise constructs and returns string in the following format: "majorVersion.minorVersionc.patchVersion"

◆ isBorland()

bool retdec::common::ToolInfo::isBorland ( ) const

◆ isCompiler()

bool retdec::common::ToolInfo::isCompiler ( ) const

◆ isFromHeuristics()

bool retdec::common::ToolInfo::isFromHeuristics ( ) const
Returns
Were heuristics used to detect usage of this tool?

◆ isGcc()

bool retdec::common::ToolInfo::isGcc ( ) const

◆ isInstaller()

bool retdec::common::ToolInfo::isInstaller ( ) const

◆ isIntel()

bool retdec::common::ToolInfo::isIntel ( ) const

◆ isKnown()

bool retdec::common::ToolInfo::isKnown ( ) const

◆ isKnownType()

bool retdec::common::ToolInfo::isKnownType ( ) const

◆ isLinker()

bool retdec::common::ToolInfo::isLinker ( ) const

◆ isMsvc()

bool retdec::common::ToolInfo::isMsvc ( const std::string &  version = "") const
Parameters
versionAny additional string which must be contained in tool name. If empty string is provided, any MSVC version is matched.

◆ isOpenWatcom()

bool retdec::common::ToolInfo::isOpenWatcom ( ) const

◆ isPacker()

bool retdec::common::ToolInfo::isPacker ( ) const

◆ isTool()

bool retdec::common::ToolInfo::isTool ( const std::string &  n) const

Checks if this tool instance matches with the provided tool name. Matching is successful if instance's name contains (case insensitive) the provided name.

Parameters
nName to match with.
Returns
True if matching successful, false otherwise.

◆ isToolVersion()

bool retdec::common::ToolInfo::isToolVersion ( const std::string &  v) const

Checks if this tool version matches with the provided tool version. Matching is successful if instance's version contains (case insensitive) the provided version.

Parameters
vVersion to match with.
Returns
True if matching successful, false otherwise.

◆ isUnknown()

bool retdec::common::ToolInfo::isUnknown ( ) const

◆ isUnknownType()

bool retdec::common::ToolInfo::isUnknownType ( ) const

◆ operator==()

bool retdec::common::ToolInfo::operator== ( const ToolInfo val) const
Returns
This instance is equal with the provided one if their names and versions are equal.

◆ setAdditionalInfo()

void retdec::common::ToolInfo::setAdditionalInfo ( const std::string &  i)

◆ setIdenticalSignificantNibbles()

void retdec::common::ToolInfo::setIdenticalSignificantNibbles ( unsigned  i)

◆ setIsBorland()

void retdec::common::ToolInfo::setIsBorland ( )

◆ setIsFromHeuristics()

void retdec::common::ToolInfo::setIsFromHeuristics ( bool  h)

◆ setIsGcc()

void retdec::common::ToolInfo::setIsGcc ( )

◆ setIsIntel()

void retdec::common::ToolInfo::setIsIntel ( )

◆ setIsOpenWatcom()

void retdec::common::ToolInfo::setIsOpenWatcom ( )

◆ setIsUnknown()

void retdec::common::ToolInfo::setIsUnknown ( )

◆ setIsVisualStudio()

void retdec::common::ToolInfo::setIsVisualStudio ( )

◆ setMajorVersion()

void retdec::common::ToolInfo::setMajorVersion ( unsigned int  v)

◆ setMinorVersion()

void retdec::common::ToolInfo::setMinorVersion ( unsigned int  v)

◆ setName()

void retdec::common::ToolInfo::setName ( const std::string &  n)

◆ setPatchVersion()

void retdec::common::ToolInfo::setPatchVersion ( unsigned int  v)

◆ setPercentage()

void retdec::common::ToolInfo::setPercentage ( double  p)

◆ setTotalSignificantNibbles()

void retdec::common::ToolInfo::setTotalSignificantNibbles ( unsigned  i)

◆ setType()

void retdec::common::ToolInfo::setType ( const std::string &  t)

◆ setVersion()

void retdec::common::ToolInfo::setVersion ( const std::string &  n)

Set provided string into version and try to parse it into its components: majorVersion minorVersionc and patchVersion. Parsing is successful only if string has the following format: "majorVersion.minorVersionc.patchVersion"

Parameters
nVersion string.

Member Data Documentation

◆ _additionalInfo

std::string retdec::common::ToolInfo::_additionalInfo
private

◆ _heuristics

bool retdec::common::ToolInfo::_heuristics = false
private

Were heuristics used to detect usage of this tool?

◆ _identicalSignificantNibbles

unsigned retdec::common::ToolInfo::_identicalSignificantNibbles = 0
private

Number of significant nibbles that were actually found.

◆ _majorVersion

unsigned int retdec::common::ToolInfo::_majorVersion = 0
private

◆ _minorVersion

unsigned int retdec::common::ToolInfo::_minorVersion = 0
private

◆ _name

std::string retdec::common::ToolInfo::_name
private

◆ _patchVersion

unsigned int retdec::common::ToolInfo::_patchVersion = 0
private

◆ _percentage

double retdec::common::ToolInfo::_percentage = 0.0
private

Probability that the tool was actually used. This does not have to be set. It is significant only if the value is not 0.0.

◆ _totalSignificantNibbles

unsigned retdec::common::ToolInfo::_totalSignificantNibbles = 0
private

Total number of significant nibbles in signature recognizing this tool.

◆ _type

std::string retdec::common::ToolInfo::_type
private

◆ _version

std::string retdec::common::ToolInfo::_version
private

Entire tool version string. If it has an expected format it may be parsed into its components majorVersion minorVersion and patchVersion.


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