retdec
|
Config in the JSON format. More...
#include <json_config.h>
Classes | |
struct | Impl |
Private implementation. More... | |
Public Member Functions | |
virtual | ~JSONConfig () override |
Debugging | |
virtual void | dump () override |
Dumps the contents of the config to the standard error. More... | |
Variables | |
virtual bool | isGlobalVarStoringWideString (const std::string &var) const override |
Stores the given global variable a wide string? More... | |
virtual std::string | comesFromGlobalVar (const std::string &func, const std::string &var) const override |
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 override |
Returns the name of the register corresponding to the given global variable. More... | |
virtual Address | getAddressForGlobalVar (const std::string &var) const override |
Returns the address of the given global variable. More... | |
virtual std::string | getDetectedCryptoPatternForGlobalVar (const std::string &var) const override |
Returns a description of the detected cryptographic pattern for the given global variable. More... | |
Functions | |
virtual std::string | getRealNameForFunc (const std::string &func) const override |
Returns the real name of the given function. More... | |
virtual AddressRange | getAddressRangeForFunc (const std::string &func) const override |
Returns the address range of the given function. More... | |
virtual LineRange | getLineRangeForFunc (const std::string &func) const override |
Returns the line range of the given function. More... | |
virtual bool | isDecompilerDefinedFunc (const std::string &func) const override |
Is the given function decompiler-defined? More... | |
virtual bool | isUserDefinedFunc (const std::string &func) const override |
Is the given function user-defined? More... | |
virtual bool | isStaticallyLinkedFunc (const std::string &func) const override |
Is the given function statically linked? More... | |
virtual bool | isDynamicallyLinkedFunc (const std::string &func) const override |
Is the given function dynamically linked? More... | |
virtual bool | isSyscallFunc (const std::string &func) const override |
Is the given function, in fact, a system call? More... | |
virtual bool | isInstructionIdiomFunc (const std::string &func) const override |
Did the given function, in fact, come from an instruction idiom? More... | |
virtual bool | isExportedFunc (const std::string &func) const override |
Is the given function exported? More... | |
virtual void | markFuncAsStaticallyLinked (const std::string &func) override |
Marks the given function as statically linked. More... | |
virtual std::string | getDeclarationStringForFunc (const std::string &func) const override |
Returns a C declaration string for the given function. More... | |
virtual std::string | getCommentForFunc (const std::string &func) const override |
Returns a comment for the given functions. More... | |
virtual StringSet | getDetectedCryptoPatternsForFunc (const std::string &func) const override |
Returns a set of names of detected cryptographic patterns that the given function uses. More... | |
virtual std::string | getWrappedFunc (const std::string &func) const override |
Returns the name of a function that func wraps. More... | |
virtual std::string | getDemangledNameOfFunc (const std::string &func) const override |
Returns the demangled named of the given function. More... | |
Classes | |
virtual StringSet | getClassNames () const override |
Returns the set of found class names. More... | |
virtual std::string | getClassForFunc (const std::string &func) const override |
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 override |
Returns the type of the given function in the given class. More... | |
virtual StringVector | getBaseClassNames (const std::string &cl) const override |
Returns the names of base classes of the given class. More... | |
virtual std::string | getDemangledNameOfClass (const std::string &cl) const override |
Returns the demangled named of the given class. More... | |
Debug Info | |
virtual bool | isDebugInfoAvailable () const override |
Is Debug info available? More... | |
virtual std::string | getDebugModuleNameForFunc (const std::string &func) const override |
Returns the name of a module from which the given function originates. More... | |
virtual StringSet | getDebugModuleNames () const override |
Returns a set of module names from which functions originate. More... | |
virtual std::string | getDebugNameForGlobalVar (const std::string &var) const override |
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 override |
Returns a name from debug information of the given local variable from the given function. More... | |
Meta Information | |
virtual std::size_t | getNumberOfFuncsDetectedInFrontend () const override |
Returns the number of functions detected in the front-end. More... | |
virtual std::string | getDetectedCompilerOrPacker () const override |
Returns the detected compiler or packer. More... | |
virtual std::string | getDetectedLanguage () const override |
Returns the detected language. More... | |
virtual StringSet | getSelectedButNotFoundFuncs () const override |
Returns a set of functions that were selected to be decompiled but were not found. More... | |
![]() | |
virtual | ~Config ()=default |
Private Member Functions | |
JSONConfig () | |
Private Attributes | |
UPtr< Impl > | impl |
Private implementation. More... | |
Loading and Saving | |
virtual void | saveTo (const std::string &path) override |
Saves the config to the given file. More... | |
static UPtr< JSONConfig > | fromFile (const std::string &path) |
Parses and returns a config from the given file. More... | |
static UPtr< JSONConfig > | fromString (const std::string &str) |
Parses and returns a config from the given JSON string. More... | |
static UPtr< JSONConfig > | empty () |
Returns an empty config. More... | |
Config in the JSON format.
|
overridevirtualdefault |
|
private |
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Dumps the contents of the config to the standard error.
Implements retdec::llvmir2hll::Config.
|
static |
Returns an empty config.
|
static |
Parses and returns a config from the given file.
JSONConfigFileNotFoundError | when the file does not exist. |
JSONConfigParsingError | when there is a parsing error. |
|
static |
Parses and returns a config from the given JSON string.
JSONConfigParsingError | when there is a parsing error. |
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the address range of the given function.
If the given function does not have an address range, NO_ADDRESS_RANGE
is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the names of base classes of the given class.
If there is no such class, the empty vector is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the set of found class names.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the name of a module from which the given function originates.
When debug info is not available, the empty string is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns a set of module names from which functions originate.
When debug info is not available, the empty set is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns a name from debug information of the given global variable.
If the variable has no such name attached, the empty string is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the detected compiler or packer.
Returns the empty string if there is no compiler or packer.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the detected language.
Returns the empty string if there is no language.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the line range of the given function.
If the given function does not have a line range, NO_LINE_RANGE
is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the number of functions detected in the front-end.
Returns 0
if there are no detected functions.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns the real name of the given function.
If the given function does not have a real name, the empty string is returned.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Returns a set of functions that were selected to be decompiled but were not found.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is Debug info available?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is the given function decompiler-defined?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is the given function dynamically linked?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
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).
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Stores the given global variable a wide string?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Did the given function, in fact, come from an instruction idiom?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is the given function statically linked?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is the given function, in fact, a system call?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Is the given function user-defined?
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Marks the given function as statically linked.
If there is no such function, nothing is done.
Implements retdec::llvmir2hll::Config.
|
overridevirtual |
Saves the config to the given file.
Implements retdec::llvmir2hll::Config.