mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 04:16:12 +00:00
Fix Default Anal Level
This commit is contained in:
parent
57d801612a
commit
08e55827b7
@ -16,13 +16,11 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main):
|
|||||||
QDialog(0), // parent must not be main
|
QDialog(0), // parent must not be main
|
||||||
ui(new Ui::InitialOptionsDialog),
|
ui(new Ui::InitialOptionsDialog),
|
||||||
main(main),
|
main(main),
|
||||||
core(Core()),
|
core(Core())
|
||||||
defaultAnalLevel(1)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
ui->logoSvgWidget->load(Config()->getLogoFile());
|
ui->logoSvgWidget->load(Config()->getLogoFile());
|
||||||
ui->analSlider->setValue(defaultAnalLevel);
|
|
||||||
|
|
||||||
// Fill the plugins combo
|
// Fill the plugins combo
|
||||||
asm_plugins = core->getAsmPluginNames();
|
asm_plugins = core->getAsmPluginNames();
|
||||||
@ -85,10 +83,13 @@ void InitialOptionsDialog::updateCPUComboBox()
|
|||||||
void InitialOptionsDialog::loadOptions(const InitialOptions &options)
|
void InitialOptionsDialog::loadOptions(const InitialOptions &options)
|
||||||
{
|
{
|
||||||
if (options.analCmd.isEmpty()) {
|
if (options.analCmd.isEmpty()) {
|
||||||
ui->analSlider->setValue(0);
|
analLevel = 0;
|
||||||
} else if (options.analCmd == QList<QString>({ "aaa" })) {
|
} else if (options.analCmd == QList<QString>({ "aaa" })) {
|
||||||
ui->analSlider->setValue(1);
|
analLevel = 1;
|
||||||
} else if (options.analCmd == QList<QString>({ "aaaa" })) {
|
} else if (options.analCmd == QList<QString>({ "aaaa" })) {
|
||||||
|
analLevel = 2;
|
||||||
|
} else {
|
||||||
|
analLevel = 3;
|
||||||
// TODO: These checks must always be in sync with getSelectedAdvancedAnalCmds(), which is dangerous
|
// TODO: These checks must always be in sync with getSelectedAdvancedAnalCmds(), which is dangerous
|
||||||
ui->aa_symbols->setChecked(options.analCmd.contains("aa"));
|
ui->aa_symbols->setChecked(options.analCmd.contains("aa"));
|
||||||
ui->aar_references->setChecked(options.analCmd.contains("aar"));
|
ui->aar_references->setChecked(options.analCmd.contains("aar"));
|
||||||
@ -108,12 +109,14 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options)
|
|||||||
if (!options.script.isEmpty()) {
|
if (!options.script.isEmpty()) {
|
||||||
ui->scriptCheckBox->setChecked(true);
|
ui->scriptCheckBox->setChecked(true);
|
||||||
ui->scriptLineEdit->setText(options.script);
|
ui->scriptLineEdit->setText(options.script);
|
||||||
ui->analSlider->setValue(0);
|
analLevel = 0;
|
||||||
} else {
|
} else {
|
||||||
ui->scriptCheckBox->setChecked(false);
|
ui->scriptCheckBox->setChecked(false);
|
||||||
ui->scriptLineEdit->setText("");
|
ui->scriptLineEdit->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->analSlider->setValue(analLevel);
|
||||||
|
|
||||||
shellcode = options.shellcode;
|
shellcode = options.shellcode;
|
||||||
|
|
||||||
// TODO: all other options should also be applied to the ui
|
// TODO: all other options should also be applied to the ui
|
||||||
@ -353,9 +356,10 @@ void InitialOptionsDialog::on_AdvOptButton_clicked()
|
|||||||
|
|
||||||
void InitialOptionsDialog::on_analCheckBox_clicked(bool checked)
|
void InitialOptionsDialog::on_analCheckBox_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if (!checked)
|
if (!checked) {
|
||||||
defaultAnalLevel = ui->analSlider->value();
|
analLevel = ui->analSlider->value();
|
||||||
ui->analSlider->setValue(checked ? defaultAnalLevel : 0);
|
}
|
||||||
|
ui->analSlider->setValue(checked ? analLevel : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitialOptionsDialog::on_archComboBox_currentIndexChanged(int)
|
void InitialOptionsDialog::on_archComboBox_currentIndexChanged(int)
|
||||||
|
@ -49,10 +49,10 @@ private:
|
|||||||
|
|
||||||
MainWindow *main;
|
MainWindow *main;
|
||||||
CutterCore *core;
|
CutterCore *core;
|
||||||
int defaultAnalLevel;
|
|
||||||
|
|
||||||
QString analysisDescription(int level);
|
QString analysisDescription(int level);
|
||||||
QString shellcode;
|
QString shellcode;
|
||||||
|
int analLevel;
|
||||||
|
|
||||||
void updateCPUComboBox();
|
void updateCPUComboBox();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ struct InitialOptions
|
|||||||
|
|
||||||
int bbsize = 0;
|
int bbsize = 0;
|
||||||
|
|
||||||
QList<QString> analCmd;
|
QList<QString> analCmd = { "aaa" };
|
||||||
|
|
||||||
QString shellcode;
|
QString shellcode;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user