retdec
Classes | Typedefs | Functions | Variables
retdec::fileinfo Namespace Reference

Classes

class  CoffDetector
 
class  ElfDetector
 
class  FileDetector
 
class  IntelHexDetector
 
class  MachODetector
 
class  PeDetector
 
class  RawDataDetector
 
class  FileInformation
 
class  CertificateTable
 
class  DataDirectory
 
struct  StreamInfo
 
class  DotnetInfo
 
class  DynamicEntry
 
class  DynamicSection
 
class  FileMapEntry
 
class  ElfCore
 
class  ElfNoteEntry
 
class  ElfNotes
 
class  ExportTable
 
class  FileHeader
 
class  FileSection
 
class  FileSegment
 
class  Flags
 
class  ImportTable
 
class  LoadedSegment
 
class  LoaderInfo
 
class  Pattern
 
class  PatternMatch
 
class  PdbInfo
 
class  Relocation
 
class  RelocationTable
 
class  Resource
 
class  ResourceTable
 
class  RichHeader
 
class  SpecialInformation
 
class  Strings
 
class  Symbol
 
class  SymbolTable
 
class  TlsInfo
 
class  VisualBasicInfo
 
class  ConfigPresentation
 
class  FilePresentation
 
class  AnomaliesPlainGetter
 
class  DataDirectoryPlainGetter
 
class  DynamicSectionsPlainGetter
 
class  ElfAuxVPlainGetter
 
class  ElfCoreMapPlainGetter
 
class  ElfNotesPlainGetter
 
class  ExportTablePlainGetter
 
class  ImportTablePlainGetter
 
class  IterativeDistributionGetter
 
class  LoaderInfoPlainGetter
 
class  MissingDepsPlainGetter
 
class  PatternMatchesPlainGetter
 
class  RelocationTablesPlainGetter
 
class  ResourcePlainGetter
 
class  RichHeaderPlainGetter
 
class  SectionPlainGetter
 
class  SegmentPlainGetter
 
class  StringsPlainGetter
 
class  SymbolTablesPlainGetter
 
class  TlsInfoPlainGetter
 
class  TypeRefTablePlainGetter
 
class  VersionInfoLanguageTablePlainGetter
 
class  VersionInfoStringTablePlainGetter
 
class  VisualBasicExternTablePlainGetter
 
class  IterativeGetter
 
class  CertificateTablePlainGetter
 
class  IterativeSimpleGetter
 
class  AnomaliesJsonGetter
 
class  DataDirectoryJsonGetter
 
class  DynamicSectionsJsonGetter
 
class  ExportTableJsonGetter
 
class  ImportTableJsonGetter
 
class  IterativeSubtitleGetter
 
class  LoaderInfoJsonGetter
 
class  MissingDepsJsonGetter
 
class  RelocationTablesJsonGetter
 
class  ResourceJsonGetter
 
class  RichHeaderJsonGetter
 
class  SectionJsonGetter
 
class  SegmentJsonGetter
 
class  StringsJsonGetter
 
class  SymbolTablesJsonGetter
 
class  TypeRefTableJsonGetter
 
class  PatternConfigGetter
 
class  BasicJsonGetter
 
class  BasicPlainGetter
 
class  DotnetPlainGetter
 
class  EntryPointJsonGetter
 
class  HeaderJsonGetter
 
class  HeaderPlainGetter
 
class  PdbJsonGetter
 
class  PdbPlainGetter
 
class  SimpleGetter
 
class  VisualBasicPlainGetter
 
class  JsonPresentation
 
class  PlainPresentation
 
class  CoffWrapper
 
class  ElfWrapper
 
class  MachOWrapper
 
class  PeWrapper
 
class  PatternDetector
 

Typedefs

using AuxVectorEntry = std::pair< std::string, std::uint64_t >
 

Functions

FileDetectorcreateFileDetector (const std::string &pathToInputFile, const std::string &dllListFile, retdec::fileformat::Format fileFormat, FileInformation &finfo, retdec::cpdetect::DetectParams &searchPar, retdec::fileformat::LoadFlags loadFlags)
 
std::string getBinaryRepresentation (unsigned long long number, unsigned long long numberOfBits)
 
template<typename N >
std::string getNumberAsString (N number, std::ios_base &(*format)(std::ios_base &)=std::dec)
 
template<typename N >
bool indexIsValid (const std::vector< N > &list, std::size_t index)
 
std::string abbvSerialization (const std::vector< std::string > &abbv)
 
void shrinkAndReplaceNonprintable (std::string &str, std::size_t maxLength)
 
void addUniqueValues (std::vector< std::string > &currentVal, const std::vector< std::string > &newVal)
 

Variables

const std::size_t MAX_NAME_LENGTH = 100
 

Typedef Documentation

◆ AuxVectorEntry

using retdec::fileinfo::AuxVectorEntry = typedef std::pair<std::string, std::uint64_t>

Function Documentation

◆ abbvSerialization()

std::string retdec::fileinfo::abbvSerialization ( const std::vector< std::string > &  abbv)

Serialization of abbreviations

Parameters
abbvVector of abbreviations
Returns
Serialized abbreviations

Abbreviations are sorted in order of their storage in abbv

◆ addUniqueValues()

void retdec::fileinfo::addUniqueValues ( std::vector< std::string > &  currentVal,
const std::vector< std::string > &  newVal 
)

To currentVal add values from newVal, which are not stored in currentVal before calling of this function

◆ createFileDetector()

FileDetector * retdec::fileinfo::createFileDetector ( const std::string &  pathToInputFile,
const std::string &  dllListFile,
retdec::fileformat::Format  fileFormat,
FileInformation finfo,
retdec::cpdetect::DetectParams searchPar,
retdec::fileformat::LoadFlags  loadFlags 
)

Create file detector

Parameters
pathToInputFilePath to input file
dllListFilePath to text file containing list of OS DLLs
fileFormatFormat of input file
finfoInstance of class for storing information about input file
searchParParameters for detection of used compiler or packer
loadFlagsLoad flags
Returns
Pointer to instance of detector or nullptr if any error

Pointer to detector is dynamically allocated and must be released (otherwise there is a memory leak). If format of input file is not supported, function will return nullptr.

◆ getBinaryRepresentation()

std::string retdec::fileinfo::getBinaryRepresentation ( unsigned long long  number,
unsigned long long  numberOfBits 
)

Get binary composition of number

Parameters
numberNumber for conversion
numberOfBitsRequired number of bits in result
Returns
String representation of binary number

◆ getNumberAsString()

template<typename N >
std::string retdec::fileinfo::getNumberAsString ( number,
std::ios_base &(*)(std::ios_base &)  format = std::dec 
)

Get number as string

Parameters
numberNumber for conversion
formatFormat of result (e.g. std::dec, std::hex)
Returns
Number in string representation or empty string if number value is incorrect

For signed numeric types is incorrect value their minimal value (e.g. INT_MIN). For unsigned numeric types is incorrect value their maximal value (e.g. UINT_MAX).

◆ indexIsValid()

template<typename N >
bool retdec::fileinfo::indexIsValid ( const std::vector< N > &  list,
std::size_t  index 
)
inline

Check vector size

Parameters
listVector for check
indexIndex of element in vector
Returns
true if index is correct in context of vector, false otherwise

◆ shrinkAndReplaceNonprintable()

void retdec::fileinfo::shrinkAndReplaceNonprintable ( std::string &  str,
std::size_t  maxLength 
)

Shrink str to max maxLength characters and replace nonprintable characters in str

Variable Documentation

◆ MAX_NAME_LENGTH

const std::size_t retdec::fileinfo::MAX_NAME_LENGTH = 100