retdec
Public Member Functions | Private Attributes | List of all members
retdec::unpackertool::upx::UpxPlugin Class Reference

#include <upx.h>

Inheritance diagram for retdec::unpackertool::upx::UpxPlugin:
Inheritance graph
[legend]
Collaboration diagram for retdec::unpackertool::upx::UpxPlugin:
Collaboration graph
[legend]

Public Member Functions

 UpxPlugin ()
 
virtual ~UpxPlugin ()
 
virtual void prepare () override
 
virtual void unpack () override
 
virtual void cleanup () override
 
- Public Member Functions inherited from retdec::unpackertool::Plugin
virtual ~Plugin ()=default
 
const Plugin::InfogetInfo () const
 
const Plugin::ArgumentsgetStartupArguments () const
 
PluginExitCode run (const Plugin::Arguments &args)
 
template<typename... Args>
void log (const Args &... args)
 
template<typename... Args>
void error (const Args &... args)
 

Private Attributes

std::unique_ptr< retdec::loader::Image_file
 Packed input file. More...
 
std::shared_ptr< UpxStub_stub
 Correct version of unpacking stub. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from retdec::unpackertool::Plugin
template<typename T >
static T * instance ()
 
- Protected Member Functions inherited from retdec::unpackertool::Plugin
 Plugin ()
 
 Plugin (const Plugin &)
 
Pluginoperator= (const Plugin &)
 
- Protected Attributes inherited from retdec::unpackertool::Plugin
Plugin::Info info
 The static info of the plugin. More...
 
Plugin::Arguments startupArgs
 Startup arguments of the plugin. More...
 

Detailed Description

UPX unpacking plugin.

This plugins starts in UpxPlugin::unpack method as every other unpacking plugin. It creates right version of UpxStub object (PeUpxStub or ElfUpxStub) Depending on the input file format. Virtual method UpxStub::detectVersion is called to check what version of unpacking stub is present in the file. In the end, UpxStub::run is called to perform unpacking.

If you want to add support for new versions of UPX, check file UpxStubSignatures.

Constructor & Destructor Documentation

◆ UpxPlugin()

retdec::unpackertool::upx::UpxPlugin::UpxPlugin ( )

Constructor.

◆ ~UpxPlugin()

retdec::unpackertool::upx::UpxPlugin::~UpxPlugin ( )
virtual

Destructor.

Member Function Documentation

◆ cleanup()

void retdec::unpackertool::upx::UpxPlugin::cleanup ( )
overridevirtual

Performs freeing of all owned resources.

Implements retdec::unpackertool::Plugin.

◆ prepare()

void retdec::unpackertool::upx::UpxPlugin::prepare ( )
overridevirtual

Performs preparation of unpacking.

Implements retdec::unpackertool::Plugin.

◆ unpack()

void retdec::unpackertool::upx::UpxPlugin::unpack ( )
overridevirtual

Starts unpacking in the current plugin.

Implements retdec::unpackertool::Plugin.

Member Data Documentation

◆ _file

std::unique_ptr<retdec::loader::Image> retdec::unpackertool::upx::UpxPlugin::_file
private

Packed input file.

◆ _stub

std::shared_ptr<UpxStub> retdec::unpackertool::upx::UpxPlugin::_stub
private

Correct version of unpacking stub.


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