diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index a2d81fb7..f95b1d4e 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -2731,28 +2731,32 @@ QStringList CutterCore::getAnalysisPluginNames() return ret; } -QList CutterCore::getRBinPluginDescriptions(const QString &type) +QList CutterCore::getBinPluginDescriptions(bool bin, bool xtr) { CORE_LOCK(); QList ret; RzListIter *it; - RzBinPlugin *bp; - CutterRzListForeach (core->bin->plugins, it, RzBinPlugin, bp) { - RzBinPluginDescription desc; - desc.name = bp->name ? bp->name : ""; - desc.description = bp->desc ? bp->desc : ""; - desc.license = bp->license ? bp->license : ""; - desc.type = "bin"; - ret.append(desc); + if (bin) { + RzBinPlugin *bp; + CutterRzListForeach (core->bin->plugins, it, RzBinPlugin, bp) { + RzBinPluginDescription desc; + desc.name = bp->name ? bp->name : ""; + desc.description = bp->desc ? bp->desc : ""; + desc.license = bp->license ? bp->license : ""; + desc.type = "bin"; + ret.append(desc); + } } - RzBinXtrPlugin *bx; - CutterRzListForeach (core->bin->binxtrs, it, RzBinXtrPlugin, bx) { - RzBinPluginDescription desc; - desc.name = bx->name ? bx->name : ""; - desc.description = bx->desc ? bx->desc : ""; - desc.license = bx->license ? bx->license : ""; - desc.type = "xtr"; - ret.append(desc); + if (xtr) { + RzBinXtrPlugin *bx; + CutterRzListForeach (core->bin->binxtrs, it, RzBinXtrPlugin, bx) { + RzBinPluginDescription desc; + desc.name = bx->name ? bx->name : ""; + desc.description = bx->desc ? bx->desc : ""; + desc.license = bx->license ? bx->license : ""; + desc.type = "xtr"; + ret.append(desc); + } } return ret; } diff --git a/src/core/Cutter.h b/src/core/Cutter.h index 687e71c3..319f54d0 100644 --- a/src/core/Cutter.h +++ b/src/core/Cutter.h @@ -534,7 +534,7 @@ public: QStringList getAnalysisPluginNames(); /* Widgets */ - QList getRBinPluginDescriptions(const QString &type = QString()); + QList getBinPluginDescriptions(bool bin = true, bool xtr = true); QList getRIOPluginDescriptions(); QList getRCorePluginDescriptions(); QList getRAsmPluginDescriptions(); diff --git a/src/dialogs/InitialOptionsDialog.cpp b/src/dialogs/InitialOptionsDialog.cpp index 54622656..437e290f 100644 --- a/src/dialogs/InitialOptionsDialog.cpp +++ b/src/dialogs/InitialOptionsDialog.cpp @@ -47,7 +47,7 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main) setTooltipWithConfigHelp(ui->kernelComboBox, "asm.os"); setTooltipWithConfigHelp(ui->bitsComboBox, "asm.bits"); - for (const auto &plugin : core->getRBinPluginDescriptions("bin")) { + for (const auto &plugin : core->getBinPluginDescriptions(true, false)) { ui->formatComboBox->addItem(plugin.name, QVariant::fromValue(plugin)); } diff --git a/src/dialogs/RizinPluginsDialog.cpp b/src/dialogs/RizinPluginsDialog.cpp index cef30200..05bee44f 100644 --- a/src/dialogs/RizinPluginsDialog.cpp +++ b/src/dialogs/RizinPluginsDialog.cpp @@ -10,7 +10,7 @@ RizinPluginsDialog::RizinPluginsDialog(QWidget *parent) { ui->setupUi(this); - for (const auto &plugin : Core()->getRBinPluginDescriptions()) { + for (const auto &plugin : Core()->getBinPluginDescriptions()) { QTreeWidgetItem *item = new QTreeWidgetItem(); item->setText(0, plugin.name); item->setText(1, plugin.description);