retdec
upx_exceptions.h
Go to the documentation of this file.
1 
7 #ifndef UNPACKERTOOL_PLUGINS_UPX_UPX_EXCEPTIONS_H
8 #define UNPACKERTOOL_PLUGINS_UPX_UPX_EXCEPTIONS_H
9 
11 
12 namespace retdec {
13 namespace unpackertool {
14 namespace upx {
15 
25 {
26 public:
27  InvalidBlockException() : FatalException("Invalid packed block found.") {}
28 };
29 
37 {
38 public:
39  explicit UnsupportedPackingMethodException(std::uint32_t packingMethod)
40  : UnsupportedInputException("Unsupported packing method 0x", std::hex, packingMethod, std::dec, " detected.") {}
41 };
42 
54 {
55 public:
56  explicit UnsupportedFilterException(std::uint32_t filterId) : UnsupportedInputException("Unsupported filter 0x", std::hex, filterId, std::dec, " detected.") {}
57 };
58 
66 {
67 public:
68  OriginalHeaderNotFoundException() : FatalException("Original header not found in unpacked data.") {}
69 };
70 
77 {
78 public:
79  OriginalHeaderCorruptedException() : FatalException("Original header contains corrupted data.") {}
80 };
81 
88 {
89 public:
90  InvalidDataDirectoryException(const std::string& directoryName) : UnsupportedInputException(directoryName, " data directory is corrupted.") {}
91 };
92 
99 {
100 public:
101  ImportNamesNotFoundException() : FatalException("Import names for fixing imports not found.") {}
102 };
103 
111 {
112 public:
113  FileMemoryDumpedException() : FatalException("File is probably unpacked by memory dumping and it is no longer valid UPX file.") {}
114 };
115 
122 {
123 public:
124  FirstBlockNotFoundException() : FatalException("First packed block not found in the file.") {}
125 };
126 
133 {
134 public:
135  NotPackedWithUpxException() : FatalException("File is not packed with UPX.") {}
136 };
137 
138 } // namespace upx
139 } // namespace unpackertool
140 } // namespace retdec
141 
142 #endif
Definition: unpacker_exception.h:79
FatalException(const Args &... args)
Definition: unpacker_exception.h:81
Definition: unpacker_exception.h:88
UnsupportedInputException(const Args &... args)
Definition: unpacker_exception.h:90
FileMemoryDumpedException()
Definition: upx_exceptions.h:113
FirstBlockNotFoundException()
Definition: upx_exceptions.h:124
ImportNamesNotFoundException()
Definition: upx_exceptions.h:101
InvalidBlockException()
Definition: upx_exceptions.h:27
InvalidDataDirectoryException(const std::string &directoryName)
Definition: upx_exceptions.h:90
NotPackedWithUpxException()
Definition: upx_exceptions.h:135
OriginalHeaderCorruptedException()
Definition: upx_exceptions.h:79
OriginalHeaderNotFoundException()
Definition: upx_exceptions.h:68
UnsupportedFilterException(std::uint32_t filterId)
Definition: upx_exceptions.h:56
UnsupportedPackingMethodException(std::uint32_t packingMethod)
Definition: upx_exceptions.h:39
Definition: archive_wrapper.h:19
Declaration of unpacker exceptions that can be subclassed in unpacker plugins.