2017-03-29 10:18:37 +00:00
|
|
|
#ifndef OPTIONSDIALOG_H
|
|
|
|
#define OPTIONSDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2019-08-03 21:58:41 +00:00
|
|
|
#include <QCheckBox>
|
2017-10-02 09:41:28 +00:00
|
|
|
#include <memory>
|
2018-10-17 07:55:53 +00:00
|
|
|
#include "common/InitialOptions.h"
|
2018-08-18 10:51:11 +00:00
|
|
|
|
2018-09-30 20:00:53 +00:00
|
|
|
namespace Ui {
|
2018-08-18 10:51:11 +00:00
|
|
|
class InitialOptionsDialog;
|
|
|
|
}
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2019-04-06 12:04:55 +00:00
|
|
|
class CutterCore;
|
2017-03-29 10:18:37 +00:00
|
|
|
class MainWindow;
|
2018-08-18 10:51:11 +00:00
|
|
|
class InitialOptionsDialog : public QDialog
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-08-18 10:51:11 +00:00
|
|
|
explicit InitialOptionsDialog(MainWindow *main);
|
|
|
|
~InitialOptionsDialog();
|
2018-05-27 14:51:01 +00:00
|
|
|
|
2023-06-25 03:42:23 +00:00
|
|
|
void setupAndStartAnalysis();
|
2017-04-28 13:09:40 +00:00
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
private slots:
|
|
|
|
void on_okButton_clicked();
|
2021-09-15 18:48:02 +00:00
|
|
|
void on_analysisSlider_valueChanged(int value);
|
2017-03-29 10:18:37 +00:00
|
|
|
void on_AdvOptButton_clicked();
|
2021-09-15 18:48:02 +00:00
|
|
|
void on_analysisCheckBox_clicked(bool checked);
|
2017-09-27 20:23:18 +00:00
|
|
|
void on_archComboBox_currentIndexChanged(int index);
|
|
|
|
void on_pdbSelectButton_clicked();
|
2018-04-30 06:39:48 +00:00
|
|
|
void on_scriptSelectButton_clicked();
|
2017-09-27 20:23:18 +00:00
|
|
|
|
|
|
|
void updatePDBLayout();
|
2018-04-30 06:39:48 +00:00
|
|
|
void updateScriptLayout();
|
2017-04-10 12:22:18 +00:00
|
|
|
|
2018-03-09 12:57:57 +00:00
|
|
|
protected:
|
2018-03-21 20:32:32 +00:00
|
|
|
void closeEvent(QCloseEvent *event) override;
|
2018-03-09 12:57:57 +00:00
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
private:
|
2018-08-18 10:51:11 +00:00
|
|
|
std::unique_ptr<Ui::InitialOptionsDialog> ui;
|
2018-07-24 16:49:52 +00:00
|
|
|
|
2017-05-13 18:09:36 +00:00
|
|
|
MainWindow *main;
|
2017-10-09 18:08:35 +00:00
|
|
|
CutterCore *core;
|
2017-04-01 11:20:13 +00:00
|
|
|
|
2017-04-10 12:22:18 +00:00
|
|
|
QString analysisDescription(int level);
|
2018-08-10 17:12:00 +00:00
|
|
|
QString shellcode;
|
2021-09-15 18:48:02 +00:00
|
|
|
int analysisLevel;
|
2020-10-28 12:28:04 +00:00
|
|
|
QList<RzAsmPluginDescription> asmPlugins;
|
2019-04-06 12:04:55 +00:00
|
|
|
|
2017-09-27 20:23:18 +00:00
|
|
|
void updateCPUComboBox();
|
2021-01-24 14:50:13 +00:00
|
|
|
struct AnalysisCommands
|
|
|
|
{
|
2019-08-03 21:58:41 +00:00
|
|
|
CommandDescription commandDesc;
|
|
|
|
QCheckBox *checkbox;
|
|
|
|
bool checked;
|
|
|
|
};
|
|
|
|
QList<AnalysisCommands> analysisCommands;
|
|
|
|
|
|
|
|
QList<QString> getAnalysisCommands(const InitialOptions &options);
|
2019-04-06 12:04:55 +00:00
|
|
|
QString getSelectedArch() const;
|
|
|
|
QString getSelectedCPU() const;
|
|
|
|
int getSelectedBits() const;
|
|
|
|
InitialOptions::Endianness getSelectedEndianness() const;
|
|
|
|
QString getSelectedOS() const;
|
2019-08-03 21:58:41 +00:00
|
|
|
QList<CommandDescription> getSelectedAdvancedAnalCmds() const;
|
2018-05-27 14:51:01 +00:00
|
|
|
|
2020-03-08 16:27:47 +00:00
|
|
|
/**
|
|
|
|
* @brief setTooltipWithConfigHelp is an helper function that add a tolltip to a widget with
|
2020-12-13 09:33:08 +00:00
|
|
|
* a description of a given Rizin eval config.
|
2020-03-08 16:27:47 +00:00
|
|
|
* @param w - a widget to which to add the tooltip
|
|
|
|
* @param config - name of a configuration variable such as "asm.bits".
|
|
|
|
*/
|
|
|
|
void setTooltipWithConfigHelp(QWidget *w, const char *config);
|
|
|
|
|
2018-08-18 16:04:45 +00:00
|
|
|
public:
|
|
|
|
void loadOptions(const InitialOptions &options);
|
|
|
|
|
2017-12-06 12:32:35 +00:00
|
|
|
void reject() override;
|
2017-03-29 10:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPTIONSDIALOG_H
|