7 #ifndef RETDEC_LLVMIR2HLL_CONFIG_CONFIGS_JSON_CONFIG_H
8 #define RETDEC_LLVMIR2HLL_CONFIG_CONFIGS_JSON_CONFIG_H
27 using JSONConfigError::JSONConfigError;
34 using JSONConfigError::JSONConfigError;
50 virtual void saveTo(
const std::string &path)
override;
55 virtual void dump()
override;
62 const std::string &var)
const override;
77 virtual bool isSyscallFunc(
const std::string &func)
const override;
79 virtual bool isExportedFunc(
const std::string &func)
const override;
84 virtual std::string
getWrappedFunc(
const std::string &func)
const override;
91 virtual std::string
getClassForFunc(
const std::string &func)
const override;
93 const std::string &cl)
const override;
105 const std::string &var)
const override;
Base class for all config-related errors.
Definition: config.h:24
ConfigError(const std::string &message)
Constructs the exception with the given error message.
Definition: config.cpp:15
Base class for all configs.
Definition: config.h:39
Base class for all exceptions raised by JSONConfig.
Definition: json_config.h:19
Exception raised when the config file does not exist.
Definition: json_config.h:26
Exception raised when there is a parsing error.
Definition: json_config.h:33
Config in the JSON format.
Definition: json_config.h:40
virtual StringSet getClassNames() const override
Returns the set of found class names.
Definition: json_config.cpp:293
virtual std::string getDemangledNameOfFunc(const std::string &func) const override
Returns the demangled named of the given function.
Definition: json_config.cpp:288
virtual bool isDynamicallyLinkedFunc(const std::string &func) const override
Is the given function dynamically linked?
Definition: json_config.cpp:241
virtual std::string getDebugNameForGlobalVar(const std::string &var) const override
Returns a name from debug information of the given global variable.
Definition: json_config.cpp:388
virtual bool isSyscallFunc(const std::string &func) const override
Is the given function, in fact, a system call?
Definition: json_config.cpp:246
virtual bool isDecompilerDefinedFunc(const std::string &func) const override
Is the given function decompiler-defined?
Definition: json_config.cpp:224
virtual std::size_t getNumberOfFuncsDetectedInFrontend() const override
Returns the number of functions detected in the front-end.
Definition: json_config.cpp:403
static UPtr< JSONConfig > fromString(const std::string &str)
Parses and returns a config from the given JSON string.
Definition: json_config.cpp:134
virtual std::string getCommentForFunc(const std::string &func) const override
Returns a comment for the given functions.
Definition: json_config.cpp:273
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.
Definition: json_config.cpp:310
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.
Definition: json_config.cpp:168
virtual bool isUserDefinedFunc(const std::string &func) const override
Is the given function user-defined?
Definition: json_config.cpp:231
virtual StringVector getBaseClassNames(const std::string &cl) const override
Returns the names of base classes of the given class.
Definition: json_config.cpp:325
static UPtr< JSONConfig > fromFile(const std::string &path)
Parses and returns a config from the given file.
Definition: json_config.cpp:115
virtual bool isInstructionIdiomFunc(const std::string &func) const override
Did the given function, in fact, come from an instruction idiom?
Definition: json_config.cpp:251
virtual bool isStaticallyLinkedFunc(const std::string &func) const override
Is the given function statically linked?
Definition: json_config.cpp:236
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.
Definition: json_config.cpp:393
virtual bool isDebugInfoAvailable() const override
Is Debug info available?
Definition: json_config.cpp:335
virtual bool isGlobalVarStoringWideString(const std::string &var) const override
Stores the given global variable a wide string?
Definition: json_config.cpp:163
virtual StringSet getDetectedCryptoPatternsForFunc(const std::string &func) const override
Returns a set of names of detected cryptographic patterns that the given function uses.
Definition: json_config.cpp:278
virtual void saveTo(const std::string &path) override
Saves the config to the given file.
Definition: json_config.cpp:153
virtual std::string getWrappedFunc(const std::string &func) const override
Returns the name of a function that func wraps.
Definition: json_config.cpp:283
virtual std::string getDetectedCompilerOrPacker() const override
Returns the detected compiler or packer.
Definition: json_config.cpp:407
virtual std::string getDetectedCryptoPatternForGlobalVar(const std::string &var) const override
Returns a description of the detected cryptographic pattern for the given global variable.
Definition: json_config.cpp:192
virtual LineRange getLineRangeForFunc(const std::string &func) const override
Returns the line range of the given function.
Definition: json_config.cpp:213
virtual std::string getDemangledNameOfClass(const std::string &cl) const override
Returns the demangled named of the given class.
Definition: json_config.cpp:330
virtual Address getAddressForGlobalVar(const std::string &var) const override
Returns the address of the given global variable.
Definition: json_config.cpp:187
static UPtr< JSONConfig > empty()
Returns an empty config.
Definition: json_config.cpp:148
virtual std::string getDebugModuleNameForFunc(const std::string &func) const override
Returns the name of a module from which the given function originates.
Definition: json_config.cpp:372
virtual void markFuncAsStaticallyLinked(const std::string &func) override
Marks the given function as statically linked.
Definition: json_config.cpp:261
virtual void dump() override
Dumps the contents of the config to the standard error.
Definition: json_config.cpp:157
virtual std::string getRegisterForGlobalVar(const std::string &var) const override
Returns the name of the register corresponding to the given global variable.
Definition: json_config.cpp:176
virtual StringSet getDebugModuleNames() const override
Returns a set of module names from which functions originate.
Definition: json_config.cpp:377
virtual AddressRange getAddressRangeForFunc(const std::string &func) const override
Returns the address range of the given function.
Definition: json_config.cpp:202
virtual std::string getDetectedLanguage() const override
Returns the detected language.
Definition: json_config.cpp:418
virtual std::string getClassForFunc(const std::string &func) const override
Returns the name of a class to which the given function belongs.
Definition: json_config.cpp:301
virtual StringSet getSelectedButNotFoundFuncs() const override
Returns a set of functions that were selected to be decompiled but were not found.
Definition: json_config.cpp:449
UPtr< Impl > impl
Private implementation.
Definition: json_config.h:120
JSONConfig()
Definition: json_config.cpp:105
virtual std::string getRealNameForFunc(const std::string &func) const override
Returns the real name of the given function.
Definition: json_config.cpp:197
virtual ~JSONConfig() override
virtual bool isExportedFunc(const std::string &func) const override
Is the given function exported?
Definition: json_config.cpp:256
virtual std::string getDeclarationStringForFunc(const std::string &func) const override
Returns a C declaration string for the given function.
Definition: json_config.cpp:268
Base class for all configs.
A library providing API for working with back-end IR.
std::vector< std::string > StringVector
Vector of strings.
Definition: types.h:87
std::unique_ptr< T > UPtr
An alias for a unique pointer.
Definition: smart_ptr.h:26
std::set< std::string > StringSet
Set of strings.
Definition: types.h:51
std::pair< std::uint64_t, std::uint64_t > LineRange
Line range.
Definition: types.h:45
Definition: archive_wrapper.h:19
Declarations, aliases, macros, etc. for the use of smart pointers.
Private implementation.
Definition: json_config.cpp:28