Removed max bbsize analysis option (#1424)

This commit is contained in:
xarkes 2019-04-14 11:36:13 +02:00 committed by Itay Cohen
parent 2fee3dabfb
commit 5b0ef4c445
7 changed files with 10 additions and 61 deletions

View File

@ -81,8 +81,6 @@ void AnalTask::runTask()
Core()->setEndianness(options.endian == InitialOptions::Endianness::Big); Core()->setEndianness(options.endian == InitialOptions::Endianness::Big);
} }
Core()->setBBSize(options.bbsize);
Core()->cmd("fs *"); Core()->cmd("fs *");
if (!options.script.isNull()) { if (!options.script.isNull()) {

View File

@ -30,8 +30,6 @@ struct InitialOptions
QString pdbFile; QString pdbFile;
QString script; QString script;
int bbsize = 0;
QList<QString> analCmd = { "aaa" }; QList<QString> analCmd = { "aaa" };
QString shellcode; QString shellcode;

View File

@ -768,11 +768,6 @@ void CutterCore::setEndianness(bool big)
setConfig("cfg.bigendian", big); setConfig("cfg.bigendian", big);
} }
void CutterCore::setBBSize(int size)
{
setConfig("anal.bb.maxsize", size);
}
QByteArray CutterCore::assemble(const QString &code) QByteArray CutterCore::assemble(const QString &code)
{ {
CORE_LOCK(); CORE_LOCK();

View File

@ -195,7 +195,6 @@ public:
void setCPU(QString arch, QString cpu, int bits); void setCPU(QString arch, QString cpu, int bits);
void setEndianness(bool big); void setEndianness(bool big);
void setBBSize(int size);
/* SDB */ /* SDB */
QList<QString> sdbList(QString path); QList<QString> sdbList(QString path);

View File

@ -28,8 +28,9 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main):
// Fill the plugins combo // Fill the plugins combo
asm_plugins = core->getAsmPluginNames(); asm_plugins = core->getAsmPluginNames();
for (const auto &plugin : asm_plugins) for (const auto &plugin : asm_plugins) {
ui->archComboBox->addItem(plugin, plugin); ui->archComboBox->addItem(plugin, plugin);
}
ui->archComboBox->setToolTip(core->cmd("e? asm.arch").trimmed()); ui->archComboBox->setToolTip(core->cmd("e? asm.arch").trimmed());
// cpu combo box // cpu combo box
@ -38,16 +39,16 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main):
updateCPUComboBox(); updateCPUComboBox();
// os combo box // os combo box
for (const auto &plugin : core->cmdList("e asm.os=?")) for (const auto &plugin : core->cmdList("e asm.os=?")) {
ui->kernelComboBox->addItem(plugin, plugin); ui->kernelComboBox->addItem(plugin, plugin);
}
ui->kernelComboBox->setToolTip(core->cmd("e? asm.os").trimmed()); ui->kernelComboBox->setToolTip(core->cmd("e? asm.os").trimmed());
ui->bitsComboBox->setToolTip(core->cmd("e? asm.bits").trimmed()); ui->bitsComboBox->setToolTip(core->cmd("e? asm.bits").trimmed());
ui->entry_analbb->setToolTip(core->cmd("e? anal.bb.maxsize").trimmed()); for (const auto &plugin : core->getRBinPluginDescriptions("bin")) {
for (const auto &plugin : core->getRBinPluginDescriptions("bin"))
ui->formatComboBox->addItem(plugin.name, QVariant::fromValue(plugin)); ui->formatComboBox->addItem(plugin.name, QVariant::fromValue(plugin));
}
ui->hideFrame->setVisible(false); ui->hideFrame->setVisible(false);
ui->analoptionsFrame->setVisible(false); ui->analoptionsFrame->setVisible(false);
@ -75,8 +76,9 @@ void InitialOptionsDialog::updateCPUComboBox()
QString cmd = "e asm.cpu=?"; QString cmd = "e asm.cpu=?";
QString arch = getSelectedArch(); QString arch = getSelectedArch();
if (!arch.isNull()) if (!arch.isNull()) {
cmd += " @a:" + arch; cmd += " @a:" + arch;
}
ui->cpuComboBox->addItem(""); ui->cpuComboBox->addItem("");
ui->cpuComboBox->addItems(core->cmdList(cmd)); ui->cpuComboBox->addItems(core->cmdList(cmd));
@ -135,8 +137,9 @@ QString InitialOptionsDialog::getSelectedArch() const
QString InitialOptionsDialog::getSelectedCPU() const QString InitialOptionsDialog::getSelectedCPU() const
{ {
QString cpu = ui->cpuComboBox->currentText(); QString cpu = ui->cpuComboBox->currentText();
if (cpu.isNull() || cpu.isEmpty()) if (cpu.isNull() || cpu.isEmpty()) {
return nullptr; return nullptr;
}
return cpu; return cpu;
} }
@ -150,16 +153,6 @@ int InitialOptionsDialog::getSelectedBits() const
return 0; return 0;
} }
int InitialOptionsDialog::getSelectedBBSize() const
{
QString sel_bbsize = ui->entry_analbb->text();
bool ok;
int bbsize = sel_bbsize.toInt(&ok);
if (ok)
return bbsize;
return 1024;
}
InitialOptions::Endianness InitialOptionsDialog::getSelectedEndianness() const InitialOptions::Endianness InitialOptionsDialog::getSelectedEndianness() const
{ {
switch (ui->endiannessComboBox->currentIndex()) { switch (ui->endiannessComboBox->currentIndex()) {
@ -266,7 +259,6 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
options.endian = getSelectedEndianness(); options.endian = getSelectedEndianness();
options.bbsize = getSelectedBBSize();
int level = ui->analSlider->value(); int level = ui->analSlider->value();
switch (level) { switch (level) {

View File

@ -53,7 +53,6 @@ private:
QString getSelectedArch() const; QString getSelectedArch() const;
QString getSelectedCPU() const; QString getSelectedCPU() const;
int getSelectedBits() const; int getSelectedBits() const;
int getSelectedBBSize() const;
InitialOptions::Endianness getSelectedEndianness() const; InitialOptions::Endianness getSelectedEndianness() const;
QString getSelectedOS() const; QString getSelectedOS() const;
QList<QString> getSelectedAdvancedAnalCmds() const; QList<QString> getSelectedAdvancedAnalCmds() const;

View File

@ -933,38 +933,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="analbbLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>BasicBlock maxsize:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="entry_analbb">
<property name="text">
<string>1024</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>