retdec
Public Member Functions | List of all members
retdec::llvmir2hll::Config Class Referenceabstract

Base class for all configs. More...

#include <config.h>

Inheritance diagram for retdec::llvmir2hll::Config:
Inheritance graph
[legend]
Collaboration diagram for retdec::llvmir2hll::Config:
Collaboration graph
[legend]

Public Member Functions

virtual ~Config ()=default
 
Loading and Saving
virtual void saveTo (const std::string &path)=0
 Saves the config to the given file. More...
 
Debugging
virtual void dump ()=0
 Dumps the contents of the config to the standard error. More...
 
Variables
virtual bool isGlobalVarStoringWideString (const std::string &var) const =0
 Stores the given global variable a wide string? More...
 
virtual std::string comesFromGlobalVar (const std::string &func, const std::string &var) const =0
 Returns the name of a global variable from which the given local variable comes from. More...
 
virtual std::string getRegisterForGlobalVar (const std::string &var) const =0
 Returns the name of the register corresponding to the given global variable. More...
 
virtual Address getAddressForGlobalVar (const std::string &var) const =0
 Returns the address of the given global variable. More...
 
virtual std::string getDetectedCryptoPatternForGlobalVar (const std::string &var) const =0
 Returns a description of the detected cryptographic pattern for the given global variable. More...
 
Functions
virtual std::string getRealNameForFunc (const std::string &func) const =0
 Returns the real name of the given function. More...
 
virtual AddressRange getAddressRangeForFunc (const std::string &func) const =0
 Returns the address range of the given function. More...
 
virtual LineRange getLineRangeForFunc (const std::string &func) const =0
 Returns the line range of the given function. More...
 
virtual bool isDecompilerDefinedFunc (const std::string &func) const =0
 Is the given function decompiler-defined? More...
 
virtual bool isUserDefinedFunc (const std::string &func) const =0
 Is the given function user-defined? More...
 
virtual bool isStaticallyLinkedFunc (const std::string &func) const =0
 Is the given function statically linked? More...
 
virtual bool isDynamicallyLinkedFunc (const std::string &func) const =0
 Is the given function dynamically linked? More...
 
virtual bool isSyscallFunc (const std::string &func) const =0
 Is the given function, in fact, a system call? More...
 
virtual bool isInstructionIdiomFunc (const std::string &func) const =0
 Did the given function, in fact, come from an instruction idiom? More...
 
virtual bool isExportedFunc (const std::string &func) const =0
 Is the given function exported? More...
 
virtual void markFuncAsStaticallyLinked (const std::string &func)=0
 Marks the given function as statically linked. More...
 
virtual std::string getDeclarationStringForFunc (const std::string &func) const =0
 Returns a C declaration string for the given function. More...
 
virtual std::string getCommentForFunc (const std::string &func) const =0
 Returns a comment for the given functions. More...
 
virtual StringSet getDetectedCryptoPatternsForFunc (const std::string &func) const =0
 Returns a set of names of detected cryptographic patterns that the given function uses. More...
 
virtual std::string getWrappedFunc (const std::string &func) const =0
 Returns the name of a function that func wraps. More...
 
virtual std::string getDemangledNameOfFunc (const std::string &func) const =0
 Returns the demangled named of the given function. More...
 
Classes
virtual StringSet getClassNames () const =0
 Returns the set of found class names. More...
 
virtual std::string getClassForFunc (const std::string &func) const =0
 Returns the name of a class to which the given function belongs. More...
 
virtual std::string getTypeOfFuncInClass (const std::string &func, const std::string &cl) const =0
 Returns the type of the given function in the given class. More...
 
virtual StringVector getBaseClassNames (const std::string &cl) const =0
 Returns the names of base classes of the given class. More...
 
virtual std::string getDemangledNameOfClass (const std::string &cl) const =0
 Returns the demangled named of the given class. More...
 
Debug Info
virtual bool isDebugInfoAvailable () const =0
 Is Debug info available? More...
 
virtual std::string getDebugModuleNameForFunc (const std::string &func) const =0
 Returns the name of a module from which the given function originates. More...
 
virtual StringSet getDebugModuleNames () const =0
 Returns a set of module names from which functions originate. More...
 
virtual std::string getDebugNameForGlobalVar (const std::string &var) const =0
 Returns a name from debug information of the given global variable. More...
 
virtual std::string getDebugNameForLocalVar (const std::string &func, const std::string &var) const =0
 Returns a name from debug information of the given local variable from the given function. More...
 
Meta Information
virtual std::size_t getNumberOfFuncsDetectedInFrontend () const =0
 Returns the number of functions detected in the front-end. More...
 
virtual std::string getDetectedCompilerOrPacker () const =0
 Returns the detected compiler or packer. More...
 
virtual std::string getDetectedLanguage () const =0
 Returns the detected language. More...
 
virtual StringSet getSelectedButNotFoundFuncs () const =0
 Returns a set of functions that were selected to be decompiled but were not found. More...
 

Additional Inherited Members

- Private Member Functions inherited from retdec::utils::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Detailed Description

Base class for all configs.

Constructor & Destructor Documentation

◆ ~Config()

virtual retdec::llvmir2hll::Config::~Config ( )
virtualdefault

Member Function Documentation

◆ comesFromGlobalVar()

virtual std::string retdec::llvmir2hll::Config::comesFromGlobalVar ( const std::string &  func,
const std::string &  var 
) const
pure virtual

Returns the name of a global variable from which the given local variable comes from.

If the given variable does not come from a global variable, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ dump()

virtual void retdec::llvmir2hll::Config::dump ( )
pure virtual

Dumps the contents of the config to the standard error.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getAddressForGlobalVar()

virtual Address retdec::llvmir2hll::Config::getAddressForGlobalVar ( const std::string &  var) const
pure virtual

Returns the address of the given global variable.

If the given variable is not a global variable or it does not have any address attached, the undefined address is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getAddressRangeForFunc()

virtual AddressRange retdec::llvmir2hll::Config::getAddressRangeForFunc ( const std::string &  func) const
pure virtual

Returns the address range of the given function.

If the given function does not have an address range, NO_ADDRESS_RANGE is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getBaseClassNames()

virtual StringVector retdec::llvmir2hll::Config::getBaseClassNames ( const std::string &  cl) const
pure virtual

Returns the names of base classes of the given class.

If there is no such class, the empty vector is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getClassForFunc()

virtual std::string retdec::llvmir2hll::Config::getClassForFunc ( const std::string &  func) const
pure virtual

Returns the name of a class to which the given function belongs.

If func does not belong to any class, the empty string is returned. If func belongs to multiple classes, the name of the first class is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getClassNames()

virtual StringSet retdec::llvmir2hll::Config::getClassNames ( ) const
pure virtual

Returns the set of found class names.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getCommentForFunc()

virtual std::string retdec::llvmir2hll::Config::getCommentForFunc ( const std::string &  func) const
pure virtual

Returns a comment for the given functions.

If the given function does not have a comment or it is empty, the empty string is returned.

Line breaks inside the comment are unified to LF.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDebugModuleNameForFunc()

virtual std::string retdec::llvmir2hll::Config::getDebugModuleNameForFunc ( const std::string &  func) const
pure virtual

Returns the name of a module from which the given function originates.

When debug info is not available, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDebugModuleNames()

virtual StringSet retdec::llvmir2hll::Config::getDebugModuleNames ( ) const
pure virtual

Returns a set of module names from which functions originate.

When debug info is not available, the empty set is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDebugNameForGlobalVar()

virtual std::string retdec::llvmir2hll::Config::getDebugNameForGlobalVar ( const std::string &  var) const
pure virtual

Returns a name from debug information of the given global variable.

If the variable has no such name attached, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDebugNameForLocalVar()

virtual std::string retdec::llvmir2hll::Config::getDebugNameForLocalVar ( const std::string &  func,
const std::string &  var 
) const
pure virtual

Returns a name from debug information of the given local variable from the given function.

If the variable has no such name attached, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDeclarationStringForFunc()

virtual std::string retdec::llvmir2hll::Config::getDeclarationStringForFunc ( const std::string &  func) const
pure virtual

Returns a C declaration string for the given function.

If the function does not exist or does not have any C declaration string attached, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDemangledNameOfClass()

virtual std::string retdec::llvmir2hll::Config::getDemangledNameOfClass ( const std::string &  cl) const
pure virtual

Returns the demangled named of the given class.

If there is no such class or its name cannot be demangled, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDemangledNameOfFunc()

virtual std::string retdec::llvmir2hll::Config::getDemangledNameOfFunc ( const std::string &  func) const
pure virtual

Returns the demangled named of the given function.

If there is no such function or its name cannot be demangled, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDetectedCompilerOrPacker()

virtual std::string retdec::llvmir2hll::Config::getDetectedCompilerOrPacker ( ) const
pure virtual

Returns the detected compiler or packer.

Returns the empty string if there is no compiler or packer.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDetectedCryptoPatternForGlobalVar()

virtual std::string retdec::llvmir2hll::Config::getDetectedCryptoPatternForGlobalVar ( const std::string &  var) const
pure virtual

Returns a description of the detected cryptographic pattern for the given global variable.

If the given variable is not a global variable or it does not have any cryptographic-pattern description attached, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDetectedCryptoPatternsForFunc()

virtual StringSet retdec::llvmir2hll::Config::getDetectedCryptoPatternsForFunc ( const std::string &  func) const
pure virtual

Returns a set of names of detected cryptographic patterns that the given function uses.

If the given function does not exist or does not use any cryptographic patterns, the empty set is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getDetectedLanguage()

virtual std::string retdec::llvmir2hll::Config::getDetectedLanguage ( ) const
pure virtual

Returns the detected language.

Returns the empty string if there is no language.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getLineRangeForFunc()

virtual LineRange retdec::llvmir2hll::Config::getLineRangeForFunc ( const std::string &  func) const
pure virtual

Returns the line range of the given function.

If the given function does not have a line range, NO_LINE_RANGE is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getNumberOfFuncsDetectedInFrontend()

virtual std::size_t retdec::llvmir2hll::Config::getNumberOfFuncsDetectedInFrontend ( ) const
pure virtual

Returns the number of functions detected in the front-end.

Returns 0 if there are no detected functions.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getRealNameForFunc()

virtual std::string retdec::llvmir2hll::Config::getRealNameForFunc ( const std::string &  func) const
pure virtual

Returns the real name of the given function.

If the given function does not have a real name, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getRegisterForGlobalVar()

virtual std::string retdec::llvmir2hll::Config::getRegisterForGlobalVar ( const std::string &  var) const
pure virtual

Returns the name of the register corresponding to the given global variable.

If the given variable is not a global variable or it does not have any register name attached, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getSelectedButNotFoundFuncs()

virtual StringSet retdec::llvmir2hll::Config::getSelectedButNotFoundFuncs ( ) const
pure virtual

Returns a set of functions that were selected to be decompiled but were not found.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getTypeOfFuncInClass()

virtual std::string retdec::llvmir2hll::Config::getTypeOfFuncInClass ( const std::string &  func,
const std::string &  cl 
) const
pure virtual

Returns the type of the given function in the given class.

The returned value is a textual representation, e.g. "constructor" or "virtual member function".

If func does not belong to any class, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ getWrappedFunc()

virtual std::string retdec::llvmir2hll::Config::getWrappedFunc ( const std::string &  func) const
pure virtual

Returns the name of a function that func wraps.

A function A wraps another function B when the only thing A does is that it calls B (with an optional prologue/epilogue).

If func does not exist or it is not a wrapper, the empty string is returned.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isDebugInfoAvailable()

virtual bool retdec::llvmir2hll::Config::isDebugInfoAvailable ( ) const
pure virtual

Is Debug info available?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isDecompilerDefinedFunc()

virtual bool retdec::llvmir2hll::Config::isDecompilerDefinedFunc ( const std::string &  func) const
pure virtual

Is the given function decompiler-defined?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isDynamicallyLinkedFunc()

virtual bool retdec::llvmir2hll::Config::isDynamicallyLinkedFunc ( const std::string &  func) const
pure virtual

Is the given function dynamically linked?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isExportedFunc()

virtual bool retdec::llvmir2hll::Config::isExportedFunc ( const std::string &  func) const
pure virtual

Is the given function exported?

A function is exported if it is marked as such in the input binary file (e.g. a DLL exports its functions).

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isGlobalVarStoringWideString()

virtual bool retdec::llvmir2hll::Config::isGlobalVarStoringWideString ( const std::string &  var) const
pure virtual

Stores the given global variable a wide string?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isInstructionIdiomFunc()

virtual bool retdec::llvmir2hll::Config::isInstructionIdiomFunc ( const std::string &  func) const
pure virtual

Did the given function, in fact, come from an instruction idiom?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isStaticallyLinkedFunc()

virtual bool retdec::llvmir2hll::Config::isStaticallyLinkedFunc ( const std::string &  func) const
pure virtual

Is the given function statically linked?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isSyscallFunc()

virtual bool retdec::llvmir2hll::Config::isSyscallFunc ( const std::string &  func) const
pure virtual

Is the given function, in fact, a system call?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ isUserDefinedFunc()

virtual bool retdec::llvmir2hll::Config::isUserDefinedFunc ( const std::string &  func) const
pure virtual

Is the given function user-defined?

Implemented in retdec::llvmir2hll::JSONConfig.

◆ markFuncAsStaticallyLinked()

virtual void retdec::llvmir2hll::Config::markFuncAsStaticallyLinked ( const std::string &  func)
pure virtual

Marks the given function as statically linked.

If there is no such function, nothing is done.

Implemented in retdec::llvmir2hll::JSONConfig.

◆ saveTo()

virtual void retdec::llvmir2hll::Config::saveTo ( const std::string &  path)
pure virtual

Saves the config to the given file.

Implemented in retdec::llvmir2hll::JSONConfig.


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