retdec
upx.h
Go to the documentation of this file.
1 
7 #ifndef UNPACKERTOOL_PLUGINS_UPX_UPX_H
8 #define UNPACKERTOOL_PLUGINS_UPX_UPX_H
9 
10 #include <memory>
11 
12 #include "retdec/loader/loader.h"
13 #include "retdec/unpacker/plugin.h"
15 
16 #define upx_plugin plugin(retdec::unpackertool::upx::UpxPlugin)
17 
18 namespace retdec {
19 namespace unpackertool {
20 namespace upx {
21 
32 class UpxPlugin : public Plugin
33 {
34 public:
35  UpxPlugin();
36  virtual ~UpxPlugin();
37 
38  virtual void prepare() override;
39  virtual void unpack() override;
40  virtual void cleanup() override;
41 
42 private:
43  std::unique_ptr<retdec::loader::Image> _file;
44  std::shared_ptr<UpxStub> _stub;
45 };
46 
47 } // namespace upx
48 } // namespace unpackertool
49 } // namespace retdec
50 
51 #endif
The abstract base of unpacking plugin.
Definition: plugin.h:51
virtual void cleanup() override
Definition: upx.cpp:101
virtual void unpack() override
Definition: upx.cpp:92
UpxPlugin()
Definition: upx.cpp:27
virtual void prepare() override
Definition: upx.cpp:46
virtual ~UpxPlugin()
Definition: upx.cpp:38
std::shared_ptr< UpxStub > _stub
Correct version of unpacking stub.
Definition: upx.h:44
std::unique_ptr< retdec::loader::Image > _file
Packed input file.
Definition: upx.h:43
Interface to loader library.
Definition: archive_wrapper.h:19
Plugin class declaration which is representation of interface to the plugin library.
Declaration of abstract UPX stub class that represents the unpacking procedure itself.