retdec
Namespaces | Classes | Typedefs | Enumerations | Functions
retdec::unpackertool Namespace Reference

Generic unpacker. More...

Namespaces

 example
 Example of an unpacker plugin.
 
 mpress
 MPRESS unpacker.
 
 upx
 UPX unpacker.
 

Classes

class  Plugin
 The abstract base of unpacking plugin. More...
 
struct  ArgData
 Argument data for command-line arguments. More...
 
struct  ArgInfo
 Metadata for commend-line arguments. More...
 
class  ArgHandler
 Command-line argument handler. More...
 
class  PluginMgr
 The manager of unpacking plugins. More...
 

Typedefs

using PluginList = std::vector< Plugin * >
 Type for list of plugins. More...
 

Enumerations

enum  PluginExitCode { PLUGIN_EXIT_UNPACKED = 0 , PLUGIN_EXIT_UNSUPPORTED , PLUGIN_EXIT_FAILED }
 
enum  ExitCode {
  EXIT_CODE_OK = 0 , EXIT_CODE_NOTHING_TO_DO , EXIT_CODE_UNPACKING_FAILED , EXIT_CODE_PREPROCESSING_ERROR ,
  EXIT_CODE_MEMORY_LIMIT_ERROR
}
 

Functions

int _main (int argc, char **argv)
 
std::ostream & operator<< (std::ostream &out, const ArgHandler &handler)
 
bool detectPackers (const std::string &inputFile, std::vector< retdec::cpdetect::DetectResult > &detectedPackers)
 
ExitCode unpackFile (const std::string &inputFile, const std::string &outputFile, bool brute, const std::vector< retdec::cpdetect::DetectResult > &detectedPackers)
 
ExitCode processArgs (ArgHandler &handler, char argc, char **argv)
 

Detailed Description

Generic unpacker.

Typedef Documentation

◆ PluginList

using retdec::unpackertool::PluginList = typedef std::vector<Plugin*>

Type for list of plugins.

Enumeration Type Documentation

◆ ExitCode

Possible exit codes of the unpacker as program.

Enumerator
EXIT_CODE_OK 

Unpacker ended successfully.

EXIT_CODE_NOTHING_TO_DO 

There was not found matching plugin.

EXIT_CODE_UNPACKING_FAILED 

At least one plugin failed at the unpacking of the file.

EXIT_CODE_PREPROCESSING_ERROR 

Error with preprocessing of input file before unpacking.

EXIT_CODE_MEMORY_LIMIT_ERROR 

There was an error when setting the memory limit.

◆ PluginExitCode

Exit code of the plugin from Plugin::unpack method.

Enumerator
PLUGIN_EXIT_UNPACKED 

Unpacking successful.

PLUGIN_EXIT_UNSUPPORTED 

Unpacking recognized valid data, but it doesn't support unpacking of them.

PLUGIN_EXIT_FAILED 

Unpacking failed because of malformed data.

Function Documentation

◆ _main()

int retdec::unpackertool::_main ( int  argc,
char **  argv 
)

◆ detectPackers()

bool retdec::unpackertool::detectPackers ( const std::string &  inputFile,
std::vector< retdec::cpdetect::DetectResult > &  detectedPackers 
)

◆ operator<<()

std::ostream& retdec::unpackertool::operator<< ( std::ostream &  out,
const ArgHandler handler 
)

Prints the help with the registered arguments.

Parameters
outThe output stream to print to.
handlerThe argument handler itself.
Returns
The output stream it prints to.

◆ processArgs()

ExitCode retdec::unpackertool::processArgs ( ArgHandler handler,
char  argc,
char **  argv 
)

◆ unpackFile()

ExitCode retdec::unpackertool::unpackFile ( const std::string &  inputFile,
const std::string &  outputFile,
bool  brute,
const std::vector< retdec::cpdetect::DetectResult > &  detectedPackers 
)