retdec
|
The abstract base of unpacking plugin. More...
#include <plugin.h>
Classes | |
struct | Arguments |
struct | Info |
The structure representing the plugin metadata. More... | |
Public Member Functions | |
virtual | ~Plugin ()=default |
const Plugin::Info * | getInfo () const |
const Plugin::Arguments * | getStartupArguments () const |
PluginExitCode | run (const Plugin::Arguments &args) |
virtual void | prepare ()=0 |
virtual void | unpack ()=0 |
virtual void | cleanup ()=0 |
template<typename... Args> | |
void | log (const Args &... args) |
template<typename... Args> | |
void | error (const Args &... args) |
Static Public Member Functions | |
template<typename T > | |
static T * | instance () |
Protected Member Functions | |
Plugin () | |
Plugin (const Plugin &) | |
Plugin & | operator= (const Plugin &) |
Protected Attributes | |
Plugin::Info | info |
The static info of the plugin. More... | |
Plugin::Arguments | startupArgs |
Startup arguments of the plugin. More... | |
Static Private Member Functions | |
template<typename T , typename... Args> | |
static void | logImpl (Logger &out, const T &data, const Args &... args) |
static void | logImpl (Logger &out) |
Private Attributes | |
PluginExitCode | _cachedExitCode |
Cached exit code of the plugin for the unpacked file. More... | |
The abstract base of unpacking plugin.
Represents the unpacking plugin capable of unpacking the specified version of packer. It is an abstract class that is implemented in every single plugin. Plugins are located in unpackertool/plugins/ where every plugin has its own folder. These steps need to be followed to create a new plugin:
Plugin<YOUR_PLUGIN_CLASS>::instance()
into PluginMgr::plugins
in unpackertool/plugin_mgr.cpp.
|
virtualdefault |
|
inlineprotected |
|
protected |
|
pure virtual |
Pure virtual method that performs freeing of all owned resources.
Implemented in retdec::unpackertool::upx::UpxPlugin, retdec::unpackertool::mpress::MpressPlugin, and retdec::unpackertool::example::ExamplePlugin.
|
inline |
Prints the error message on the standard error output prepending the message with '[ERROR] [PLUGIN-NAME]'. End of line is automatically inserted at the end of the message.
Args | Types of data to print. |
args | Data to print. |
|
inline |
Returns the static info of the plugin.
|
inline |
Returns the startup arguments of the plugin.
|
inlinestatic |
Returns the instance of specific type of plugin. This should be the only way how plugin instances are obtained.
|
inline |
Prints the message on the standard output prepending the message with '[PLUGIN-NAME]'. End of line is automatically inserted at the end of the message.
Args | Types of data to print. |
args | Data to print. |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
pure virtual |
Pure virtual method that performs preparation of unpacking.
Implemented in retdec::unpackertool::upx::UpxPlugin, retdec::unpackertool::mpress::MpressPlugin, and retdec::unpackertool::example::ExamplePlugin.
|
inline |
Runs the plugin and all its phases. Also sets the startup arguments of the plugin.
args | The plugin arguments. See Plugin::Info. |
|
pure virtual |
Pure virtual method that performs the unpacking in the specific plugins.
Implemented in retdec::unpackertool::upx::UpxPlugin, retdec::unpackertool::mpress::MpressPlugin, and retdec::unpackertool::example::ExamplePlugin.
|
private |
Cached exit code of the plugin for the unpacked file.
|
protected |
The static info of the plugin.
|
protected |
Startup arguments of the plugin.