retdec
Public Attributes | List of all members
retdec::cpdetect::ToolInformation Struct Reference

#include <cptypes.h>

Collaboration diagram for retdec::cpdetect::ToolInformation:
Collaboration graph
[legend]

Public Member Functions

Adding result methods
void addTool (DetectionMethod source, DetectionStrength strength, ToolType toolType, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addTool (std::size_t matchNibbles, std::size_t totalNibbles, ToolType toolType, const std::string &name, const std::string &version="", const std::string &extra="")
 
void addLanguage (const std::string &name, const std::string &extra="", bool bytecode=false)
 
Query methods
bool isReliableResult (std::size_t resultIndex) const
 
bool hasReliableResult () const
 
Packed isPacked () const
 

Public Attributes

std::vector< std::string > errorMessages
 error and warning messages More...
 
std::vector< DetectResultdetectedTools
 detected tools (compilers, packers...) More...
 
std::vector< DetectLanguagedetectedLanguages
 detected programming language(s) More...
 
bool entryPointOffset = false
 false if file has no has no or invalid EP offset More...
 
long long unsigned int epOffset
 entry point offset More...
 
bool entryPointAddress = false
 false if file has no has no or invalid EP address More...
 
long long unsigned int epAddress
 entry point address More...
 
long long unsigned int imageBase
 image base address More...
 
uint64_t overlayOffset = 0
 offset of the file overlay. 0 if no overlay More...
 
size_t overlaySize = 0
 length of the file overlay. 0 if no overlay More...
 
bool entryPointSection = false
 false if file has no or invalid EP section More...
 
retdec::fileformat::Section epSection
 entry point section More...
 
std::string epBytes
 hexadecimal representation of entry point bytes More...
 

Detailed Description

All information about used tools

If entryPointOffset is false, value of epOffset is undefined. If entryPointSection is false, values of epSection are undefined. If entryPointAddress is false, values of epAddress and imageBase are undefined.

Value std::numeric_limits<long long unsigned int>::max() mean unspecified value or error for unsigned integer types.

Member Function Documentation

◆ addLanguage()

void retdec::cpdetect::ToolInformation::addLanguage ( const std::string &  name,
const std::string &  extra = "",
bool  bytecode = false 
)

Save all information about detected language

Parameters
nameName of detected language
extraExtra information about detected language
bytecodeWhether language uses byte-code

◆ addTool() [1/2]

void retdec::cpdetect::ToolInformation::addTool ( DetectionMethod  source,
DetectionStrength  strength,
ToolType  toolType,
const std::string &  name,
const std::string &  version = "",
const std::string &  extra = "" 
)

Add detected tool

Parameters
sourceUsed detection method
strengthStrength of detection method
toolTypeType of detected tool
nameName of detected compiler
versionVersion of detected compiler
extraExtra information about compiler

◆ addTool() [2/2]

void retdec::cpdetect::ToolInformation::addTool ( std::size_t  matchNibbles,
std::size_t  totalNibbles,
ToolType  toolType,
const std::string &  name,
const std::string &  version = "",
const std::string &  extra = "" 
)

Save all information about detected compiler

Parameters
matchNibblesNumber of significant nibbles agreeing with file content
totalNibblesTotal number of significant nibbles of signature
toolTypeType of detected tool
nameName of detected compiler
versionVersion of detected compiler
extraExtra information about compiler

This method implies DetectionMethod::SIGNATURE. Strength is computed.

◆ hasReliableResult()

bool retdec::cpdetect::ToolInformation::hasReliableResult ( ) const

Check if at least one reliable result was detected

Returns
true if at least one reliable result was detected, false otherwise

◆ isPacked()

Packed retdec::cpdetect::ToolInformation::isPacked ( ) const

Check possible packing

Returns
detection level of possible packing
Todo:
add entropy computation

◆ isReliableResult()

bool retdec::cpdetect::ToolInformation::isReliableResult ( std::size_t  resultIndex) const

Check out if detected result is reliable

Parameters
resultIndexIndex of selected result
Returns
true if selected result is detected based on reliable source, false otherwise

Member Data Documentation

◆ detectedLanguages

std::vector<DetectLanguage> retdec::cpdetect::ToolInformation::detectedLanguages

detected programming language(s)

◆ detectedTools

std::vector<DetectResult> retdec::cpdetect::ToolInformation::detectedTools

detected tools (compilers, packers...)

◆ entryPointAddress

bool retdec::cpdetect::ToolInformation::entryPointAddress = false

false if file has no has no or invalid EP address

◆ entryPointOffset

bool retdec::cpdetect::ToolInformation::entryPointOffset = false

false if file has no has no or invalid EP offset

◆ entryPointSection

bool retdec::cpdetect::ToolInformation::entryPointSection = false

false if file has no or invalid EP section

◆ epAddress

long long unsigned int retdec::cpdetect::ToolInformation::epAddress
Initial value:
=
std::numeric_limits<long long unsigned int>::max()

entry point address

◆ epBytes

std::string retdec::cpdetect::ToolInformation::epBytes

hexadecimal representation of entry point bytes

◆ epOffset

long long unsigned int retdec::cpdetect::ToolInformation::epOffset
Initial value:
=
std::numeric_limits<long long unsigned int>::max()

entry point offset

◆ epSection

retdec::fileformat::Section retdec::cpdetect::ToolInformation::epSection

entry point section

◆ errorMessages

std::vector<std::string> retdec::cpdetect::ToolInformation::errorMessages

error and warning messages

◆ imageBase

long long unsigned int retdec::cpdetect::ToolInformation::imageBase
Initial value:
=
std::numeric_limits<long long unsigned int>::max()

image base address

◆ overlayOffset

uint64_t retdec::cpdetect::ToolInformation::overlayOffset = 0

offset of the file overlay. 0 if no overlay

◆ overlaySize

size_t retdec::cpdetect::ToolInformation::overlaySize = 0

length of the file overlay. 0 if no overlay


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