Skip to content

Commit

Permalink
Remove plugin.pkgname because not used anymore (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ret2libc authored Jan 16, 2023
1 parent db7d1ce commit 9dc896f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/rz-plugin/console/decompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class DecompilerConsole: public Console {
/// Register all decompilation commands into the given RzCmd instance.
static bool registerCommands(RzCmd* cmd);

/// Deregister all decompilation commands into the given RzCmd instance.
static bool deregisterCommands(RzCmd* cmd);

public:
/// Representation of pdz command.
static const Console::Command DecompileCurrent;
Expand Down
6 changes: 6 additions & 0 deletions src/rz-plugin/console/decompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ bool DecompilerConsole::registerCommands(RzCmd* cmd)
return DecompilerConsole::console.registerConsole(cmd, root_desc, CMD_PREFIX);
}

bool DecompilerConsole::deregisterCommands(RzCmd* cmd)
{
RzCmdDesc* retdec_desc = rz_cmd_get_desc(cmd, CMD_PREFIX);
return rz_cmd_desc_remove(cmd, retdec_desc);
}

RzAnnotatedCode *DecompilerConsole::runDecompile(RzCore *core)
{
std::lock_guard<std::recursive_mutex> lock(mutex);
Expand Down
8 changes: 6 additions & 2 deletions src/rz-plugin/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ static bool rz_retdec_init(RzCore *core)
return DecompilerConsole::registerCommands(core->rcmd);
}

static bool rz_retdec_fini(RzCore *core)
{
return DecompilerConsole::deregisterCommands(core->rcmd);
}

// Structure containing plugin info.
RzCorePlugin rz_core_plugin_retdec = {
/* .name = */ "rz-retdec",
Expand All @@ -29,7 +34,7 @@ RzCorePlugin rz_core_plugin_retdec = {
/* .author = */ "RizinOrg and Avast",
/* .version = */ nullptr,
/* .init = */ rz_retdec_init,
/* .fini = */ nullptr
/* .fini = */ rz_retdec_fini,
};

#ifndef CORELIB
Expand All @@ -43,7 +48,6 @@ RZ_API RzLibStruct rizin_plugin = {
/* .data = */ &rz_core_plugin_retdec,
/* .version = */ RZ_VERSION,
/* .free = */ nullptr,
/* .pkgname */ "rz-retdec"
};

#endif

0 comments on commit 9dc896f

Please sign in to comment.