diff --git a/src/AnalThread.cpp b/src/AnalThread.cpp index 49ae64f2..04498386 100644 --- a/src/AnalThread.cpp +++ b/src/AnalThread.cpp @@ -105,6 +105,8 @@ void AnalThread::run() core->setEndianness(optionsDialog->getSelectedEndianness() == OptionsDialog::Endianness::Big); } + core->setBBSize(optionsDialog->getSelectedBBSize()); + // use prj.simple as default as long as regular projects are broken core->setConfig("prj.simple", true); diff --git a/src/Cutter.cpp b/src/Cutter.cpp index 9ebc86b1..1344581a 100644 --- a/src/Cutter.cpp +++ b/src/Cutter.cpp @@ -599,6 +599,11 @@ void CutterCore::setEndianness(bool big) setConfig("cfg.bigendian", big); } +void CutterCore::setBBSize(int size) +{ + setConfig("anal.bb.maxsize", size); +} + void CutterCore::setDefaultCPU() { if (!default_arch.isEmpty()) diff --git a/src/Cutter.h b/src/Cutter.h index e638158c..5dd1eef8 100644 --- a/src/Cutter.h +++ b/src/Cutter.h @@ -318,6 +318,8 @@ public: void setDefaultCPU(); void setCPU(QString arch, QString cpu, int bits, bool temporary = false); void setEndianness(bool big); + void setBBSize(int size); + RAnalFunction *functionAt(ut64 addr); QString cmdFunctionAt(QString addr); QString cmdFunctionAt(RVA addr); diff --git a/src/dialogs/OptionsDialog.cpp b/src/dialogs/OptionsDialog.cpp index 5ac21147..02bff66c 100644 --- a/src/dialogs/OptionsDialog.cpp +++ b/src/dialogs/OptionsDialog.cpp @@ -42,7 +42,8 @@ OptionsDialog::OptionsDialog(MainWindow *main): ui->bitsComboBox->setToolTip(core->cmd("e? asm.bits").trimmed()); - + ui->entry_analbb->setToolTip(core->cmd("e? anal.bb.maxsize").trimmed()); + for (auto plugin : core->getRBinPluginDescriptions("bin")) ui->formatComboBox->addItem(plugin.name, QVariant::fromValue(plugin)); @@ -113,6 +114,16 @@ int OptionsDialog::getSelectedBits() return 0; } +int OptionsDialog::getSelectedBBSize() +{ + QString sel_bbsize = ui->entry_analbb->text(); + bool ok; + int bbsize = sel_bbsize.toInt(&ok); + if (ok) + return bbsize; + return 1024; +} + OptionsDialog::Endianness OptionsDialog::getSelectedEndianness() { switch(ui->endiannessComboBox->currentIndex()) diff --git a/src/dialogs/OptionsDialog.h b/src/dialogs/OptionsDialog.h index 12ef3b99..5c943a3e 100644 --- a/src/dialogs/OptionsDialog.h +++ b/src/dialogs/OptionsDialog.h @@ -53,13 +53,14 @@ private: void setInteractionEnabled(bool enabled); public: - enum class Endianness { Auto, Little, Big }; + enum class Endianness { Auto, Little, Big }; std::unique_ptr ui; QString getSelectedArch(); QString getSelectedCPU(); int getSelectedBits(); + int getSelectedBBSize(); Endianness getSelectedEndianness(); QString getSelectedOS(); QTimer analTimer; diff --git a/src/dialogs/OptionsDialog.ui b/src/dialogs/OptionsDialog.ui index 548b4a8f..8820cda9 100644 --- a/src/dialogs/OptionsDialog.ui +++ b/src/dialogs/OptionsDialog.ui @@ -900,6 +900,43 @@ + + + + + 0 + 0 + + + + + 0 + 0 + + + + BasicBlock maxsize: + + + + + + + + 12 + + + + 1024 + + + false + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + +