diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97aefbfb..a8cead25 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,7 +24,7 @@ set(SOURCES common/DirectionalComboBox.cpp dialogs/preferences/AsmOptionsWidget.cpp dialogs/NewFileDialog.cpp - common/AnalTask.cpp + common/AnalysisTask.cpp widgets/CommentsWidget.cpp widgets/ConsoleWidget.cpp widgets/Dashboard.cpp @@ -139,7 +139,7 @@ set(SOURCES widgets/RizinGraphWidget.cpp widgets/CallGraph.cpp widgets/AddressableDockWidget.cpp - dialogs/preferences/AnalOptionsWidget.cpp + dialogs/preferences/AnalysisOptionsWidget.cpp common/DecompilerHighlighter.cpp dialogs/GlibcHeapInfoDialog.cpp widgets/HeapDockWidget.cpp @@ -173,7 +173,7 @@ set(HEADER_FILES common/DirectionalComboBox.h dialogs/InitialOptionsDialog.h dialogs/NewFileDialog.h - common/AnalTask.h + common/AnalysisTask.h widgets/CommentsWidget.h widgets/ConsoleWidget.h widgets/Dashboard.h @@ -298,7 +298,7 @@ set(HEADER_FILES widgets/RizinGraphWidget.h widgets/CallGraph.h widgets/AddressableDockWidget.h - dialogs/preferences/AnalOptionsWidget.h + dialogs/preferences/AnalysisOptionsWidget.h common/DecompilerHighlighter.h dialogs/GlibcHeapInfoDialog.h widgets/HeapDockWidget.h @@ -371,7 +371,7 @@ set(UI_FILES widgets/ListDockWidget.ui dialogs/LayoutManager.ui widgets/RizinGraphWidget.ui - dialogs/preferences/AnalOptionsWidget.ui + dialogs/preferences/AnalysisOptionsWidget.ui dialogs/GlibcHeapInfoDialog.ui widgets/HeapDockWidget.ui widgets/GlibcHeapWidget.ui diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index 60937679..d0134c91 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -149,7 +149,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc } mainWindow->displayNewFileDialog(); } else { // filename specified as positional argument - bool askOptions = (clOptions.analLevel != AutomaticAnalysisLevel::Ask) + bool askOptions = (clOptions.analysisLevel != AutomaticAnalysisLevel::Ask) || !clOptions.fileOpenOptions.projectFile.isEmpty(); mainWindow->openNewFile(clOptions.fileOpenOptions, askOptions); } @@ -378,30 +378,30 @@ bool CutterApplication::parseCommandLineOptions() opts.args = cmd_parser.positionalArguments(); if (cmd_parser.isSet(analOption)) { - bool analLevelSpecified = false; - int analLevel = cmd_parser.value(analOption).toInt(&analLevelSpecified); + bool analysisLevelSpecified = false; + int analysisLevel = cmd_parser.value(analOption).toInt(&analysisLevelSpecified); - if (!analLevelSpecified || analLevel < 0 || analLevel > 2) { + if (!analysisLevelSpecified || analysisLevel < 0 || analysisLevel > 2) { fprintf(stderr, "%s\n", QObject::tr("Invalid Analysis Level. May be a value between 0 and 2.") .toLocal8Bit() .constData()); return false; } - switch (analLevel) { + switch (analysisLevel) { case 0: - opts.analLevel = AutomaticAnalysisLevel::None; + opts.analysisLevel = AutomaticAnalysisLevel::None; break; case 1: - opts.analLevel = AutomaticAnalysisLevel::AAA; + opts.analysisLevel = AutomaticAnalysisLevel::AAA; break; case 2: - opts.analLevel = AutomaticAnalysisLevel::AAAA; + opts.analysisLevel = AutomaticAnalysisLevel::AAAA; break; } } - if (opts.args.empty() && opts.analLevel != AutomaticAnalysisLevel::Ask) { + if (opts.args.empty() && opts.analysisLevel != AutomaticAnalysisLevel::Ask) { fprintf(stderr, "%s\n", QObject::tr("Filename must be specified to start analysis automatically.") .toLocal8Bit() @@ -420,17 +420,17 @@ bool CutterApplication::parseCommandLineOptions() options.binLoadAddr = baddr; } } - switch (opts.analLevel) { + switch (opts.analysisLevel) { case AutomaticAnalysisLevel::Ask: break; case AutomaticAnalysisLevel::None: - opts.fileOpenOptions.analCmd = {}; + opts.fileOpenOptions.analysisCmd = {}; break; case AutomaticAnalysisLevel::AAA: - opts.fileOpenOptions.analCmd = { { "aaa", "Auto analysis" } }; + opts.fileOpenOptions.analysisCmd = { { "aaa", "Auto analysis" } }; break; case AutomaticAnalysisLevel::AAAA: - opts.fileOpenOptions.analCmd = { { "aaaa", "Auto analysis (experimental)" } }; + opts.fileOpenOptions.analysisCmd = { { "aaaa", "Auto analysis (experimental)" } }; break; } opts.fileOpenOptions.script = cmd_parser.value(scriptOption); diff --git a/src/CutterApplication.h b/src/CutterApplication.h index cf2fd4d0..f8dc01e3 100644 --- a/src/CutterApplication.h +++ b/src/CutterApplication.h @@ -13,7 +13,7 @@ enum class AutomaticAnalysisLevel { Ask, None, AAA, AAAA }; struct CutterCommandLineOptions { QStringList args; - AutomaticAnalysisLevel analLevel = AutomaticAnalysisLevel::Ask; + AutomaticAnalysisLevel analysisLevel = AutomaticAnalysisLevel::Ask; InitialOptions fileOpenOptions; QString pythonHome; bool outputRedirectionEnabled = true; diff --git a/src/common/AnalTask.cpp b/src/common/AnalysisTask.cpp similarity index 90% rename from src/common/AnalTask.cpp rename to src/common/AnalysisTask.cpp index 7a9fda27..5752a470 100644 --- a/src/common/AnalTask.cpp +++ b/src/common/AnalysisTask.cpp @@ -1,22 +1,22 @@ #include "core/Cutter.h" -#include "common/AnalTask.h" +#include "common/AnalysisTask.h" #include "core/MainWindow.h" #include "dialogs/InitialOptionsDialog.h" #include #include #include -AnalTask::AnalTask() : AsyncTask() {} +AnalysisTask::AnalysisTask() : AsyncTask() {} -AnalTask::~AnalTask() {} +AnalysisTask::~AnalysisTask() {} -void AnalTask::interrupt() +void AnalysisTask::interrupt() { AsyncTask::interrupt(); rz_cons_singleton()->context->breaked = true; } -QString AnalTask::getTitle() +QString AnalysisTask::getTitle() { // If no file is loaded we consider it's Initial Analysis RzCoreLocked core(Core()); @@ -27,7 +27,7 @@ QString AnalTask::getTitle() return tr("Analyzing Program"); } -void AnalTask::runTask() +void AnalysisTask::runTask() { int perms = RZ_PERM_RX; if (options.writeEnabled) { @@ -96,9 +96,9 @@ void AnalTask::runTask() return; } - if (!options.analCmd.empty()) { + if (!options.analysisCmd.empty()) { log(tr("Executing analysis...")); - for (const CommandDescription &cmd : options.analCmd) { + for (const CommandDescription &cmd : options.analysisCmd) { if (isInterrupted()) { return; } diff --git a/src/common/AnalTask.h b/src/common/AnalysisTask.h similarity index 87% rename from src/common/AnalTask.h rename to src/common/AnalysisTask.h index 305d8fc2..6b992fd9 100644 --- a/src/common/AnalTask.h +++ b/src/common/AnalysisTask.h @@ -9,13 +9,13 @@ class CutterCore; class MainWindow; class InitialOptionsDialog; -class AnalTask : public AsyncTask +class AnalysisTask : public AsyncTask { Q_OBJECT public: - explicit AnalTask(); - ~AnalTask(); + explicit AnalysisTask(); + ~AnalysisTask(); QString getTitle() override; diff --git a/src/common/InitialOptions.h b/src/common/InitialOptions.h index 9e6413b0..36ede2d4 100644 --- a/src/common/InitialOptions.h +++ b/src/common/InitialOptions.h @@ -40,7 +40,7 @@ struct InitialOptions QString pdbFile; QString script; - QList analCmd = { { "aaa", "Auto analysis" } }; + QList analysisCmd = { { "aaa", "Auto analysis" } }; QString shellcode; }; diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 8791250c..439c4db3 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -2706,7 +2706,7 @@ QStringList CutterCore::getAsmPluginNames() return ret; } -QStringList CutterCore::getAnalPluginNames() +QStringList CutterCore::getAnalysisPluginNames() { CORE_LOCK(); RzListIter *it; @@ -3305,7 +3305,7 @@ QList CutterCore::getAllClassesFromFlags() return ret; } -QList CutterCore::getAllAnalClasses(bool sorted) +QList CutterCore::getAllAnalysisClasses(bool sorted) { CORE_LOCK(); QList ret; @@ -3327,10 +3327,10 @@ QList CutterCore::getAllAnalClasses(bool sorted) return ret; } -QList CutterCore::getAnalClassMethods(const QString &cls) +QList CutterCore::getAnalysisClassMethods(const QString &cls) { CORE_LOCK(); - QList ret; + QList ret; RzVector *meths = rz_analysis_class_method_get_all(core->analysis, cls.toUtf8().constData()); if (!meths) { @@ -3341,7 +3341,7 @@ QList CutterCore::getAnalClassMethods(const QString &cls) RzAnalysisMethod *meth; CutterRzVectorForeach(meths, meth, RzAnalysisMethod) { - AnalMethodDescription desc; + AnalysisMethodDescription desc; desc.name = QString::fromUtf8(meth->name); desc.addr = meth->addr; desc.vtableOffset = meth->vtable_offset; @@ -3352,10 +3352,10 @@ QList CutterCore::getAnalClassMethods(const QString &cls) return ret; } -QList CutterCore::getAnalClassBaseClasses(const QString &cls) +QList CutterCore::getAnalysisClassBaseClasses(const QString &cls) { CORE_LOCK(); - QList ret; + QList ret; RzVector *bases = rz_analysis_class_base_get_all(core->analysis, cls.toUtf8().constData()); if (!bases) { @@ -3366,7 +3366,7 @@ QList CutterCore::getAnalClassBaseClasses(const QStrin RzAnalysisBaseClass *base; CutterRzVectorForeach(bases, base, RzAnalysisBaseClass) { - AnalBaseClassDescription desc; + AnalysisBaseClassDescription desc; desc.id = QString::fromUtf8(base->id); desc.offset = base->offset; desc.className = QString::fromUtf8(base->class_name); @@ -3377,10 +3377,10 @@ QList CutterCore::getAnalClassBaseClasses(const QStrin return ret; } -QList CutterCore::getAnalClassVTables(const QString &cls) +QList CutterCore::getAnalysisClassVTables(const QString &cls) { CORE_LOCK(); - QList acVtables; + QList acVtables; RzVector *vtables = rz_analysis_class_vtable_get_all(core->analysis, cls.toUtf8().constData()); if (!vtables) { @@ -3391,7 +3391,7 @@ QList CutterCore::getAnalClassVTables(const QString &cls) RzAnalysisVTable *vtable; CutterRzVectorForeach(vtables, vtable, RzAnalysisVTable) { - AnalVTableDescription desc; + AnalysisVTableDescription desc; desc.id = QString::fromUtf8(vtable->id); desc.offset = vtable->offset; desc.addr = vtable->addr; @@ -3421,34 +3421,34 @@ void CutterCore::deleteClass(const QString &cls) rz_analysis_class_delete(core->analysis, cls.toUtf8().constData()); } -bool CutterCore::getAnalMethod(const QString &cls, const QString &meth, AnalMethodDescription *desc) +bool CutterCore::getAnalysisMethod(const QString &cls, const QString &meth, AnalysisMethodDescription *desc) { CORE_LOCK(); - RzAnalysisMethod analMeth; + RzAnalysisMethod analysisMeth; if (rz_analysis_class_method_get(core->analysis, cls.toUtf8().constData(), - meth.toUtf8().constData(), &analMeth) + meth.toUtf8().constData(), &analysisMeth) != RZ_ANALYSIS_CLASS_ERR_SUCCESS) { return false; } - desc->name = QString::fromUtf8(analMeth.name); - desc->addr = analMeth.addr; - desc->vtableOffset = analMeth.vtable_offset; - rz_analysis_class_method_fini(&analMeth); + desc->name = QString::fromUtf8(analysisMeth.name); + desc->addr = analysisMeth.addr; + desc->vtableOffset = analysisMeth.vtable_offset; + rz_analysis_class_method_fini(&analysisMeth); return true; } -void CutterCore::setAnalMethod(const QString &className, const AnalMethodDescription &meth) +void CutterCore::setAnalysisMethod(const QString &className, const AnalysisMethodDescription &meth) { CORE_LOCK(); - RzAnalysisMethod analMeth; - analMeth.name = strdup(meth.name.toUtf8().constData()); - analMeth.addr = meth.addr; - analMeth.vtable_offset = meth.vtableOffset; - rz_analysis_class_method_set(core->analysis, className.toUtf8().constData(), &analMeth); - rz_analysis_class_method_fini(&analMeth); + RzAnalysisMethod analysisMeth; + analysisMeth.name = strdup(meth.name.toUtf8().constData()); + analysisMeth.addr = meth.addr; + analysisMeth.vtable_offset = meth.vtableOffset; + rz_analysis_class_method_set(core->analysis, className.toUtf8().constData(), &analysisMeth); + rz_analysis_class_method_fini(&analysisMeth); } -void CutterCore::renameAnalMethod(const QString &className, const QString &oldMethodName, +void CutterCore::renameAnalysisMethod(const QString &className, const QString &oldMethodName, const QString &newMethodName) { CORE_LOCK(); diff --git a/src/core/Cutter.h b/src/core/Cutter.h index cd382444..54a7bb55 100644 --- a/src/core/Cutter.h +++ b/src/core/Cutter.h @@ -260,17 +260,17 @@ public: void applyStructureOffset(const QString &structureOffset, RVA offset = RVA_INVALID); /* Classes */ - QList getAllAnalClasses(bool sorted); - QList getAnalClassMethods(const QString &cls); - QList getAnalClassBaseClasses(const QString &cls); - QList getAnalClassVTables(const QString &cls); + QList getAllAnalysisClasses(bool sorted); + QList getAnalysisClassMethods(const QString &cls); + QList getAnalysisClassBaseClasses(const QString &cls); + QList getAnalysisClassVTables(const QString &cls); void createNewClass(const QString &cls); void renameClass(const QString &oldName, const QString &newName); void deleteClass(const QString &cls); - bool getAnalMethod(const QString &cls, const QString &meth, AnalMethodDescription *desc); - void renameAnalMethod(const QString &className, const QString &oldMethodName, + bool getAnalysisMethod(const QString &cls, const QString &meth, AnalysisMethodDescription *desc); + void renameAnalysisMethod(const QString &className, const QString &oldMethodName, const QString &newMethodName); - void setAnalMethod(const QString &cls, const AnalMethodDescription &meth); + void setAnalysisMethod(const QString &cls, const AnalysisMethodDescription &meth); /* File related methods */ bool loadFile(QString path, ut64 baddr = 0LL, ut64 mapaddr = 0LL, int perms = RZ_PERM_R, @@ -531,7 +531,7 @@ public: /* Plugins */ QStringList getAsmPluginNames(); - QStringList getAnalPluginNames(); + QStringList getAnalysisPluginNames(); /* Widgets */ QList getRBinPluginDescriptions(const QString &type = QString()); diff --git a/src/core/CutterDescriptions.h b/src/core/CutterDescriptions.h index 12170f92..aa786185 100644 --- a/src/core/CutterDescriptions.h +++ b/src/core/CutterDescriptions.h @@ -244,21 +244,21 @@ struct BinClassDescription QList fields; }; -struct AnalMethodDescription +struct AnalysisMethodDescription { QString name; RVA addr; st64 vtableOffset; }; -struct AnalBaseClassDescription +struct AnalysisBaseClassDescription { QString id; RVA offset; QString className; }; -struct AnalVTableDescription +struct AnalysisVTableDescription { QString id; ut64 offset; @@ -404,9 +404,9 @@ Q_DECLARE_METATYPE(BinClassDescription) Q_DECLARE_METATYPE(const BinClassDescription *) Q_DECLARE_METATYPE(const BinClassMethodDescription *) Q_DECLARE_METATYPE(const BinClassFieldDescription *) -Q_DECLARE_METATYPE(AnalBaseClassDescription) -Q_DECLARE_METATYPE(AnalMethodDescription) -Q_DECLARE_METATYPE(AnalVTableDescription) +Q_DECLARE_METATYPE(AnalysisBaseClassDescription) +Q_DECLARE_METATYPE(AnalysisMethodDescription) +Q_DECLARE_METATYPE(AnalysisVTableDescription) Q_DECLARE_METATYPE(ResourcesDescription) Q_DECLARE_METATYPE(VTableDescription) Q_DECLARE_METATYPE(TypeDescription) diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index 9677317a..e7cbe173 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -2,7 +2,7 @@ #include "ui_MainWindow.h" // Common Headers -#include "common/AnalTask.h" +#include "common/AnalysisTask.h" #include "common/BugReporting.h" #include "common/Highlighter.h" #include "common/Helpers.h" @@ -1652,19 +1652,19 @@ void MainWindow::on_actionRefresh_Panels_triggered() */ void MainWindow::on_actionAnalyze_triggered() { - auto *analTask = new AnalTask(); + auto *analysisTask = new AnalysisTask(); InitialOptions options; - options.analCmd = { { "aaa", "Auto analysis" } }; - analTask->setOptions(options); - AsyncTask::Ptr analTaskPtr(analTask); + options.analysisCmd = { { "aaa", "Auto analysis" } }; + analysisTask->setOptions(options); + AsyncTask::Ptr analysisTaskPtr(analysisTask); - auto *taskDialog = new AsyncTaskDialog(analTaskPtr); + auto *taskDialog = new AsyncTaskDialog(analysisTaskPtr); taskDialog->setInterruptOnClose(true); taskDialog->setAttribute(Qt::WA_DeleteOnClose); taskDialog->show(); - connect(analTask, &AnalTask::finished, this, &MainWindow::refreshAll); + connect(analysisTask, &AnalysisTask::finished, this, &MainWindow::refreshAll); - Core()->getAsyncTaskManager()->start(analTaskPtr); + Core()->getAsyncTaskManager()->start(analysisTaskPtr); } void MainWindow::on_actionImportPDB_triggered() diff --git a/src/dialogs/EditMethodDialog.cpp b/src/dialogs/EditMethodDialog.cpp index fef6251e..28914f80 100644 --- a/src/dialogs/EditMethodDialog.cpp +++ b/src/dialogs/EditMethodDialog.cpp @@ -15,7 +15,7 @@ EditMethodDialog::EditMethodDialog(bool classFixed, QWidget *parent) } else { classComboBox = new QComboBox(this); ui->formLayout->setItem(0, QFormLayout::FieldRole, new QWidgetItem(classComboBox)); - for (auto &cls : Core()->getAllAnalClasses(true)) { + for (auto &cls : Core()->getAllAnalysisClasses(true)) { classComboBox->addItem(cls, cls); } } @@ -86,7 +86,7 @@ void EditMethodDialog::setClass(const QString &className) validateInput(); } -void EditMethodDialog::setMethod(const AnalMethodDescription &desc) +void EditMethodDialog::setMethod(const AnalysisMethodDescription &desc) { ui->nameEdit->setText(desc.name); ui->addressEdit->setText(desc.addr != RVA_INVALID ? RzAddressString(desc.addr) : nullptr); @@ -116,9 +116,9 @@ QString EditMethodDialog::getClass() const } } -AnalMethodDescription EditMethodDialog::getMethod() const +AnalysisMethodDescription EditMethodDialog::getMethod() const { - AnalMethodDescription ret; + AnalysisMethodDescription ret; ret.name = ui->nameEdit->text(); ret.addr = Core()->num(ui->addressEdit->text()); if (!ui->virtualCheckBox->isChecked()) { @@ -130,7 +130,7 @@ AnalMethodDescription EditMethodDialog::getMethod() const } bool EditMethodDialog::showDialog(const QString &title, bool classFixed, QString *className, - AnalMethodDescription *desc, QWidget *parent) + AnalysisMethodDescription *desc, QWidget *parent) { EditMethodDialog dialog(classFixed, parent); dialog.setWindowTitle(title); @@ -144,7 +144,7 @@ bool EditMethodDialog::showDialog(const QString &title, bool classFixed, QString void EditMethodDialog::newMethod(QString className, const QString &meth, QWidget *parent) { - AnalMethodDescription desc; + AnalysisMethodDescription desc; desc.name = meth; desc.vtableOffset = -1; desc.addr = Core()->getOffset(); @@ -153,13 +153,13 @@ void EditMethodDialog::newMethod(QString className, const QString &meth, QWidget return; } - Core()->setAnalMethod(className, desc); + Core()->setAnalysisMethod(className, desc); } void EditMethodDialog::editMethod(const QString &className, const QString &meth, QWidget *parent) { - AnalMethodDescription desc; - if (!Core()->getAnalMethod(className, meth, &desc)) { + AnalysisMethodDescription desc; + if (!Core()->getAnalysisMethod(className, meth, &desc)) { return; } @@ -168,7 +168,7 @@ void EditMethodDialog::editMethod(const QString &className, const QString &meth, return; } if (desc.name != meth) { - Core()->renameAnalMethod(className, meth, desc.name); + Core()->renameAnalysisMethod(className, meth, desc.name); } - Core()->setAnalMethod(className, desc); + Core()->setAnalysisMethod(className, desc); } diff --git a/src/dialogs/EditMethodDialog.h b/src/dialogs/EditMethodDialog.h index a7a59bcc..df414977 100644 --- a/src/dialogs/EditMethodDialog.h +++ b/src/dialogs/EditMethodDialog.h @@ -24,10 +24,10 @@ public: ~EditMethodDialog(); void setClass(const QString &className); - void setMethod(const AnalMethodDescription &desc); + void setMethod(const AnalysisMethodDescription &desc); QString getClass() const; - AnalMethodDescription getMethod() const; + AnalysisMethodDescription getMethod() const; /** * @brief Helper function to display the dialog @@ -39,7 +39,7 @@ public: * @return whether the dialog was accepted by the user */ static bool showDialog(const QString &title, bool classFixed, QString *className, - AnalMethodDescription *desc, QWidget *parent = nullptr); + AnalysisMethodDescription *desc, QWidget *parent = nullptr); /** * @brief Show the dialog to add a new method a given class diff --git a/src/dialogs/InitialOptionsDialog.cpp b/src/dialogs/InitialOptionsDialog.cpp index be171879..54622656 100644 --- a/src/dialogs/InitialOptionsDialog.cpp +++ b/src/dialogs/InitialOptionsDialog.cpp @@ -13,7 +13,7 @@ #include #include "core/Cutter.h" -#include "common/AnalTask.h" +#include "common/AnalysisTask.h" InitialOptionsDialog::InitialOptionsDialog(MainWindow *main) : QDialog(nullptr), // parent must not be main @@ -83,7 +83,7 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main) } ui->hideFrame->setVisible(false); - ui->analoptionsFrame->setVisible(false); + ui->analysisoptionsFrame->setVisible(false); ui->advancedAnlysisLine->setVisible(false); updatePDBLayout(); @@ -132,7 +132,7 @@ void InitialOptionsDialog::updateCPUComboBox() QList InitialOptionsDialog::getAnalysisCommands(const InitialOptions &options) { QList commands; - for (auto &commandDesc : options.analCmd) { + for (auto &commandDesc : options.analysisCmd) { commands << commandDesc.command; } return commands; @@ -140,14 +140,14 @@ QList InitialOptionsDialog::getAnalysisCommands(const InitialOptions &o void InitialOptionsDialog::loadOptions(const InitialOptions &options) { - if (options.analCmd.isEmpty()) { - analLevel = 0; - } else if (options.analCmd.first().command == "aaa") { - analLevel = 1; - } else if (options.analCmd.first().command == "aaaa") { - analLevel = 2; + if (options.analysisCmd.isEmpty()) { + analysisLevel = 0; + } else if (options.analysisCmd.first().command == "aaa") { + analysisLevel = 1; + } else if (options.analysisCmd.first().command == "aaaa") { + analysisLevel = 2; } else { - analLevel = 3; + analysisLevel = 3; AnalysisCommands item; QList commands = getAnalysisCommands(options); foreach (item, analysisCommands) { @@ -159,13 +159,13 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options) if (!options.script.isEmpty()) { ui->scriptCheckBox->setChecked(true); ui->scriptLineEdit->setText(options.script); - analLevel = 0; + analysisLevel = 0; } else { ui->scriptCheckBox->setChecked(false); ui->scriptLineEdit->setText(""); } - ui->analSlider->setValue(analLevel); + ui->analysisSlider->setValue(analysisLevel); shellcode = options.shellcode; @@ -235,7 +235,7 @@ QString InitialOptionsDialog::getSelectedOS() const QList InitialOptionsDialog::getSelectedAdvancedAnalCmds() const { QList advanced = QList(); - if (ui->analSlider->value() == 3) { + if (ui->analysisSlider->value() == 3) { AnalysisCommands item; foreach (item, analysisCommands) { if (item.checkbox->isChecked()) { @@ -284,42 +284,42 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList adv options.endian = getSelectedEndianness(); - int level = ui->analSlider->value(); + int level = ui->analysisSlider->value(); switch (level) { case 1: - options.analCmd = { { "aaa", "Auto analysis" } }; + options.analysisCmd = { { "aaa", "Auto analysis" } }; break; case 2: - options.analCmd = { { "aaaa", "Auto analysis (experimental)" } }; + options.analysisCmd = { { "aaaa", "Auto analysis (experimental)" } }; break; case 3: - options.analCmd = getSelectedAdvancedAnalCmds(); + options.analysisCmd = getSelectedAdvancedAnalCmds(); break; default: - options.analCmd = {}; + options.analysisCmd = {}; break; } - AnalTask *analTask = new AnalTask(); - analTask->setOptions(options); + AnalysisTask *analysisTask = new AnalysisTask(); + analysisTask->setOptions(options); MainWindow *main = this->main; - connect(analTask, &AnalTask::openFileFailed, main, &MainWindow::openNewFileFailed); - connect(analTask, &AsyncTask::finished, main, [analTask, main]() { - if (analTask->getOpenFileFailed()) { + connect(analysisTask, &AnalysisTask::openFileFailed, main, &MainWindow::openNewFileFailed); + connect(analysisTask, &AsyncTask::finished, main, [analysisTask, main]() { + if (analysisTask->getOpenFileFailed()) { return; } main->finalizeOpen(); }); - AsyncTask::Ptr analTaskPtr(analTask); + AsyncTask::Ptr analysisTaskPtr(analysisTask); - AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr); + AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analysisTaskPtr); taskDialog->setInterruptOnClose(true); taskDialog->setAttribute(Qt::WA_DeleteOnClose); taskDialog->show(); - Core()->getAsyncTaskManager()->start(analTaskPtr); + Core()->getAsyncTaskManager()->start(analysisTaskPtr); done(0); } @@ -352,20 +352,20 @@ QString InitialOptionsDialog::analysisDescription(int level) } } -void InitialOptionsDialog::on_analSlider_valueChanged(int value) +void InitialOptionsDialog::on_analysisSlider_valueChanged(int value) { ui->analDescription->setText(tr("Level") + QString(": %1").arg(analysisDescription(value))); if (value == 0) { - ui->analCheckBox->setChecked(false); - ui->analCheckBox->setText(tr("Analysis: Disabled")); + ui->analysisCheckBox->setChecked(false); + ui->analysisCheckBox->setText(tr("Analysis: Disabled")); } else { - ui->analCheckBox->setChecked(true); - ui->analCheckBox->setText(tr("Analysis: Enabled")); + ui->analysisCheckBox->setChecked(true); + ui->analysisCheckBox->setText(tr("Analysis: Enabled")); if (value == 3) { - ui->analoptionsFrame->setVisible(true); + ui->analysisoptionsFrame->setVisible(true); ui->advancedAnlysisLine->setVisible(true); } else { - ui->analoptionsFrame->setVisible(false); + ui->analysisoptionsFrame->setVisible(false); ui->advancedAnlysisLine->setVisible(false); } } @@ -382,12 +382,12 @@ void InitialOptionsDialog::on_AdvOptButton_clicked() } } -void InitialOptionsDialog::on_analCheckBox_clicked(bool checked) +void InitialOptionsDialog::on_analysisCheckBox_clicked(bool checked) { if (!checked) { - analLevel = ui->analSlider->value(); + analysisLevel = ui->analysisSlider->value(); } - ui->analSlider->setValue(checked ? analLevel : 0); + ui->analysisSlider->setValue(checked ? analysisLevel : 0); } void InitialOptionsDialog::on_archComboBox_currentIndexChanged(int) diff --git a/src/dialogs/InitialOptionsDialog.h b/src/dialogs/InitialOptionsDialog.h index f8c24003..90de4394 100644 --- a/src/dialogs/InitialOptionsDialog.h +++ b/src/dialogs/InitialOptionsDialog.h @@ -24,9 +24,9 @@ public: private slots: void on_okButton_clicked(); - void on_analSlider_valueChanged(int value); + void on_analysisSlider_valueChanged(int value); void on_AdvOptButton_clicked(); - void on_analCheckBox_clicked(bool checked); + void on_analysisCheckBox_clicked(bool checked); void on_archComboBox_currentIndexChanged(int index); void on_pdbSelectButton_clicked(); void on_scriptSelectButton_clicked(); @@ -45,7 +45,7 @@ private: QString analysisDescription(int level); QString shellcode; - int analLevel; + int analysisLevel; QList asmPlugins; void updateCPUComboBox(); diff --git a/src/dialogs/InitialOptionsDialog.ui b/src/dialogs/InitialOptionsDialog.ui index ebb18ae0..3b8cc363 100644 --- a/src/dialogs/InitialOptionsDialog.ui +++ b/src/dialogs/InitialOptionsDialog.ui @@ -144,7 +144,7 @@ - + 0 @@ -181,7 +181,7 @@ - + 0 @@ -277,7 +277,7 @@ QLayout::SetMinimumSize - + true diff --git a/src/dialogs/preferences/AnalOptionsWidget.cpp b/src/dialogs/preferences/AnalysisOptionsWidget.cpp similarity index 59% rename from src/dialogs/preferences/AnalOptionsWidget.cpp rename to src/dialogs/preferences/AnalysisOptionsWidget.cpp index 83ed18b6..53d00f2f 100644 --- a/src/dialogs/preferences/AnalOptionsWidget.cpp +++ b/src/dialogs/preferences/AnalysisOptionsWidget.cpp @@ -1,5 +1,5 @@ -#include "AnalOptionsWidget.h" -#include "ui_AnalOptionsWidget.h" +#include "AnalysisOptionsWidget.h" +#include "ui_AnalysisOptionsWidget.h" #include "PreferencesDialog.h" @@ -8,7 +8,7 @@ #include "core/MainWindow.h" -static const QHash analBoundaries { +static const QHash analysisBoundaries { { "io.maps.x", "All executable maps" }, { "io.maps", "All maps" }, { "io.map", "Current map" }, @@ -17,8 +17,8 @@ static const QHash analBoundaries { { "bin.sections", "All mapped sections" }, }; -AnalOptionsWidget::AnalOptionsWidget(PreferencesDialog *dialog) - : QDialog(dialog), ui(new Ui::AnalOptionsWidget) +AnalysisOptionsWidget::AnalysisOptionsWidget(PreferencesDialog *dialog) + : QDialog(dialog), ui(new Ui::AnalysisOptionsWidget) { ui->setupUi(this); @@ -31,7 +31,7 @@ AnalOptionsWidget::AnalOptionsWidget(PreferencesDialog *dialog) { ui->verboseCheckBox, "analysis.verbose" } }; // Create list of options for the analysis.in selector - createAnalInOptionsList(); + createAnalysisInOptionsList(); // Connect each checkbox from "checkboxes" to the generic signal "checkboxEnabler" for (ConfigCheckbox &confCheckbox : checkboxes) { @@ -45,23 +45,23 @@ AnalOptionsWidget::AnalOptionsWidget(PreferencesDialog *dialog) auto *mainWindow = new MainWindow(this); connect(ui->analyzePushButton, &QPushButton::clicked, mainWindow, &MainWindow::on_actionAnalyze_triggered); - connect(ui->analInComboBox, &QComboBox::currentIndexChanged, this, - &AnalOptionsWidget::updateAnalIn); + connect(ui->analysisInComboBox, &QComboBox::currentIndexChanged, this, + &AnalysisOptionsWidget::updateAnalysisIn); connect(ui->ptrDepthSpinBox, &QSpinBox::valueChanged, this, - &AnalOptionsWidget::updateAnalPtrDepth); + &AnalysisOptionsWidget::updateAnalysisPtrDepth); connect(ui->preludeLineEdit, &QLineEdit::textChanged, this, - &AnalOptionsWidget::updateAnalPrelude); - updateAnalOptionsFromVars(); + &AnalysisOptionsWidget::updateAnalysisPrelude); + updateAnalysisOptionsFromVars(); } -AnalOptionsWidget::~AnalOptionsWidget() {} +AnalysisOptionsWidget::~AnalysisOptionsWidget() {} -void AnalOptionsWidget::checkboxEnabler(QCheckBox *checkBox, const QString &config) +void AnalysisOptionsWidget::checkboxEnabler(QCheckBox *checkBox, const QString &config) { Config()->setConfig(config, checkBox->isChecked()); } -void AnalOptionsWidget::updateAnalOptionsFromVars() +void AnalysisOptionsWidget::updateAnalysisOptionsFromVars() { for (ConfigCheckbox &confCheckbox : checkboxes) { qhelpers::setCheckedWithoutSignals(confCheckbox.checkBox, @@ -69,36 +69,36 @@ void AnalOptionsWidget::updateAnalOptionsFromVars() } // Update the rest of analysis options that are not checkboxes - ui->analInComboBox->setCurrentIndex( - ui->analInComboBox->findData(Core()->getConfig("analysis.in"))); + ui->analysisInComboBox->setCurrentIndex( + ui->analysisInComboBox->findData(Core()->getConfig("analysis.in"))); ui->ptrDepthSpinBox->setValue(Core()->getConfigi("analysis.ptrdepth")); ui->preludeLineEdit->setText(Core()->getConfig("analysis.prelude")); } -void AnalOptionsWidget::updateAnalIn(int index) +void AnalysisOptionsWidget::updateAnalysisIn(int index) { - Config()->setConfig("analysis.in", ui->analInComboBox->itemData(index).toString()); + Config()->setConfig("analysis.in", ui->analysisInComboBox->itemData(index).toString()); } -void AnalOptionsWidget::updateAnalPtrDepth(int value) +void AnalysisOptionsWidget::updateAnalysisPtrDepth(int value) { Config()->setConfig("analysis.ptrdepth", value); } -void AnalOptionsWidget::updateAnalPrelude(const QString &prelude) +void AnalysisOptionsWidget::updateAnalysisPrelude(const QString &prelude) { Config()->setConfig("analysis.prelude", prelude); } -void AnalOptionsWidget::createAnalInOptionsList() +void AnalysisOptionsWidget::createAnalysisInOptionsList() { QHash::const_iterator mapIter; - mapIter = analBoundaries.cbegin(); - ui->analInComboBox->blockSignals(true); - ui->analInComboBox->clear(); - for (; mapIter != analBoundaries.cend(); ++mapIter) { - ui->analInComboBox->addItem(mapIter.value(), mapIter.key()); + mapIter = analysisBoundaries.cbegin(); + ui->analysisInComboBox->blockSignals(true); + ui->analysisInComboBox->clear(); + for (; mapIter != analysisBoundaries.cend(); ++mapIter) { + ui->analysisInComboBox->addItem(mapIter.value(), mapIter.key()); } - ui->analInComboBox->blockSignals(false); + ui->analysisInComboBox->blockSignals(false); } diff --git a/src/dialogs/preferences/AnalOptionsWidget.h b/src/dialogs/preferences/AnalysisOptionsWidget.h similarity index 77% rename from src/dialogs/preferences/AnalOptionsWidget.h rename to src/dialogs/preferences/AnalysisOptionsWidget.h index fcb01ec6..bf50d0e7 100644 --- a/src/dialogs/preferences/AnalOptionsWidget.h +++ b/src/dialogs/preferences/AnalysisOptionsWidget.h @@ -9,19 +9,19 @@ class PreferencesDialog; namespace Ui { -class AnalOptionsWidget; +class AnalysisOptionsWidget; } -class AnalOptionsWidget : public QDialog +class AnalysisOptionsWidget : public QDialog { Q_OBJECT public: - explicit AnalOptionsWidget(PreferencesDialog *dialog); - ~AnalOptionsWidget(); + explicit AnalysisOptionsWidget(PreferencesDialog *dialog); + ~AnalysisOptionsWidget(); private: - std::unique_ptr ui; + std::unique_ptr ui; struct ConfigCheckbox { QCheckBox *checkBox; @@ -33,14 +33,14 @@ private: * @brief This function creates the list with the different options shown in the selector for * analysis.in */ - void createAnalInOptionsList(); + void createAnalysisInOptionsList(); private slots: /** * @brief A slot to display the options in the dialog according to the current analysis.* * configuration */ - void updateAnalOptionsFromVars(); + void updateAnalysisOptionsFromVars(); /** * @brief A generic slot to handle the simple cases where a checkbox is toggled @@ -54,20 +54,20 @@ private slots: * @brief A slot to update the value of analysis.in when a different option is selected * @param index - The index of the selected option for analysis.in */ - void updateAnalIn(int index); + void updateAnalysisIn(int index); /** * @brief A slot to update the value of analysis.ptrdepth when a new value is selected * @param value - The new value for analysis.ptrdepth */ - static void updateAnalPtrDepth(int value); + static void updateAnalysisPtrDepth(int value); /** * @brief slot to update the value of analysis.prelude when a new value is introduced in the * corresponding textbox * @param prelude - The new value for analysis.prelude */ - static void updateAnalPrelude(const QString &prelude); + static void updateAnalysisPrelude(const QString &prelude); }; #endif // ANALOPTIONSWIDGET_H diff --git a/src/dialogs/preferences/AnalOptionsWidget.ui b/src/dialogs/preferences/AnalysisOptionsWidget.ui similarity index 98% rename from src/dialogs/preferences/AnalOptionsWidget.ui rename to src/dialogs/preferences/AnalysisOptionsWidget.ui index 725506f4..9968558a 100644 --- a/src/dialogs/preferences/AnalOptionsWidget.ui +++ b/src/dialogs/preferences/AnalysisOptionsWidget.ui @@ -1,7 +1,7 @@ - AnalOptionsWidget - + AnalysisOptionsWidget + 0 @@ -163,7 +163,7 @@ - + diff --git a/src/dialogs/preferences/PreferencesDialog.cpp b/src/dialogs/preferences/PreferencesDialog.cpp index 968e08f1..26550901 100644 --- a/src/dialogs/preferences/PreferencesDialog.cpp +++ b/src/dialogs/preferences/PreferencesDialog.cpp @@ -7,7 +7,7 @@ #include "DebugOptionsWidget.h" #include "PluginsOptionsWidget.h" #include "InitializationFileEditor.h" -#include "AnalOptionsWidget.h" +#include "AnalysisOptionsWidget.h" #include "PreferenceCategory.h" @@ -36,7 +36,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) { tr("Plugins"), new PluginsOptionsWidget(this), QIcon(":/img/icons/plugins.svg") }, { tr("Initialization Script"), new InitializationFileEditor(this), QIcon(":/img/icons/initialization.svg") }, - { tr("Analysis"), new AnalOptionsWidget(this), QIcon(":/img/icons/cog_light.svg") } + { tr("Analysis"), new AnalysisOptionsWidget(this), QIcon(":/img/icons/cog_light.svg") } }; for (auto &c : prefs) { diff --git a/src/widgets/ClassesWidget.cpp b/src/widgets/ClassesWidget.cpp index 4378d064..9185ce03 100644 --- a/src/widgets/ClassesWidget.cpp +++ b/src/widgets/ClassesWidget.cpp @@ -204,24 +204,24 @@ QVariant BinClassesModel::data(const QModelIndex &index, int role) const } } -AnalClassesModel::AnalClassesModel(CutterDockWidget *parent) +AnalysisClassesModel::AnalysisClassesModel(CutterDockWidget *parent) : ClassesModel(parent), attrs(new QMap>) { // Just use a simple refresh deferrer. If an event was triggered in the background, simply // refresh everything later. refreshDeferrer = parent->createRefreshDeferrer([this]() { this->refreshAll(); }); - connect(Core(), &CutterCore::refreshAll, this, &AnalClassesModel::refreshAll); - connect(Core(), &CutterCore::codeRebased, this, &AnalClassesModel::refreshAll); - connect(Core(), &CutterCore::classNew, this, &AnalClassesModel::classNew); - connect(Core(), &CutterCore::classDeleted, this, &AnalClassesModel::classDeleted); - connect(Core(), &CutterCore::classRenamed, this, &AnalClassesModel::classRenamed); - connect(Core(), &CutterCore::classAttrsChanged, this, &AnalClassesModel::classAttrsChanged); + connect(Core(), &CutterCore::refreshAll, this, &AnalysisClassesModel::refreshAll); + connect(Core(), &CutterCore::codeRebased, this, &AnalysisClassesModel::refreshAll); + connect(Core(), &CutterCore::classNew, this, &AnalysisClassesModel::classNew); + connect(Core(), &CutterCore::classDeleted, this, &AnalysisClassesModel::classDeleted); + connect(Core(), &CutterCore::classRenamed, this, &AnalysisClassesModel::classRenamed); + connect(Core(), &CutterCore::classAttrsChanged, this, &AnalysisClassesModel::classAttrsChanged); refreshAll(); } -void AnalClassesModel::refreshAll() +void AnalysisClassesModel::refreshAll() { if (!refreshDeferrer->attemptRefresh(nullptr)) { return; @@ -229,11 +229,11 @@ void AnalClassesModel::refreshAll() beginResetModel(); attrs->clear(); - classes = Core()->getAllAnalClasses(true); // must be sorted + classes = Core()->getAllAnalysisClasses(true); // must be sorted endResetModel(); } -void AnalClassesModel::classNew(const QString &cls) +void AnalysisClassesModel::classNew(const QString &cls) { if (!refreshDeferrer->attemptRefresh(nullptr)) { return; @@ -247,7 +247,7 @@ void AnalClassesModel::classNew(const QString &cls) endInsertRows(); } -void AnalClassesModel::classDeleted(const QString &cls) +void AnalysisClassesModel::classDeleted(const QString &cls) { if (!refreshDeferrer->attemptRefresh(nullptr)) { return; @@ -264,7 +264,7 @@ void AnalClassesModel::classDeleted(const QString &cls) endRemoveRows(); } -void AnalClassesModel::classRenamed(const QString &oldName, const QString &newName) +void AnalysisClassesModel::classRenamed(const QString &oldName, const QString &newName) { if (!refreshDeferrer->attemptRefresh(nullptr)) { return; @@ -296,7 +296,7 @@ void AnalClassesModel::classRenamed(const QString &oldName, const QString &newNa emit dataChanged(index(newRow, 0), index(newRow, 0)); } -void AnalClassesModel::classAttrsChanged(const QString &cls) +void AnalysisClassesModel::classAttrsChanged(const QString &cls) { if (!refreshDeferrer->attemptRefresh(nullptr)) { return; @@ -312,35 +312,35 @@ void AnalClassesModel::classAttrsChanged(const QString &cls) layoutChanged({ persistentIndex }); } -const QVector &AnalClassesModel::getAttrs(const QString &cls) const +const QVector &AnalysisClassesModel::getAttrs(const QString &cls) const { auto it = attrs->find(cls); if (it != attrs->end()) { return it.value(); } - QVector clsAttrs; - QList bases = Core()->getAnalClassBaseClasses(cls); - QList meths = Core()->getAnalClassMethods(cls); - QList vtables = Core()->getAnalClassVTables(cls); + QVector clsAttrs; + QList bases = Core()->getAnalysisClassBaseClasses(cls); + QList meths = Core()->getAnalysisClassMethods(cls); + QList vtables = Core()->getAnalysisClassVTables(cls); clsAttrs.reserve(bases.size() + meths.size() + vtables.size()); - for (const AnalBaseClassDescription &base : bases) { + for (const AnalysisBaseClassDescription &base : bases) { clsAttrs.push_back(Attribute(Attribute::Type::Base, QVariant::fromValue(base))); } - for (const AnalVTableDescription &vtable : vtables) { + for (const AnalysisVTableDescription &vtable : vtables) { clsAttrs.push_back(Attribute(Attribute::Type::VTable, QVariant::fromValue(vtable))); } - for (const AnalMethodDescription &meth : meths) { + for (const AnalysisMethodDescription &meth : meths) { clsAttrs.push_back(Attribute(Attribute::Type::Method, QVariant::fromValue(meth))); } return attrs->insert(cls, clsAttrs).value(); } -QModelIndex AnalClassesModel::index(int row, int column, const QModelIndex &parent) const +QModelIndex AnalysisClassesModel::index(int row, int column, const QModelIndex &parent) const { if (!parent.isValid()) { return createIndex(row, column, (quintptr)0); // root function nodes have id = 0 @@ -350,7 +350,7 @@ QModelIndex AnalClassesModel::index(int row, int column, const QModelIndex &pare (quintptr)parent.row() + 1); // sub-nodes have id = class index + 1 } -QModelIndex AnalClassesModel::parent(const QModelIndex &index) const +QModelIndex AnalysisClassesModel::parent(const QModelIndex &index) const { if (!index.isValid()) { return {}; @@ -363,7 +363,7 @@ QModelIndex AnalClassesModel::parent(const QModelIndex &index) const } } -int AnalClassesModel::rowCount(const QModelIndex &parent) const +int AnalysisClassesModel::rowCount(const QModelIndex &parent) const { if (!parent.isValid()) { // root return classes.count(); @@ -376,17 +376,17 @@ int AnalClassesModel::rowCount(const QModelIndex &parent) const return 0; // below methods/fields } -bool AnalClassesModel::hasChildren(const QModelIndex &parent) const +bool AnalysisClassesModel::hasChildren(const QModelIndex &parent) const { return !parent.isValid() || !parent.parent().isValid(); } -int AnalClassesModel::columnCount(const QModelIndex &) const +int AnalysisClassesModel::columnCount(const QModelIndex &) const { return Columns::COUNT; } -QVariant AnalClassesModel::data(const QModelIndex &index, int role) const +QVariant AnalysisClassesModel::data(const QModelIndex &index, int role) const { if (index.internalId() == 0) { // class row if (index.row() >= classes.count()) { @@ -417,7 +417,7 @@ QVariant AnalClassesModel::data(const QModelIndex &index, int role) const switch (attr.type) { case Attribute::Type::Base: { - AnalBaseClassDescription base = attr.data.value(); + AnalysisBaseClassDescription base = attr.data.value(); switch (role) { case Qt::DisplayRole: switch (index.column()) { @@ -448,7 +448,7 @@ QVariant AnalClassesModel::data(const QModelIndex &index, int role) const break; } case Attribute::Type::Method: { - AnalMethodDescription meth = attr.data.value(); + AnalysisMethodDescription meth = attr.data.value(); switch (role) { case Qt::DisplayRole: switch (index.column()) { @@ -484,7 +484,7 @@ QVariant AnalClassesModel::data(const QModelIndex &index, int role) const break; } case Attribute::Type::VTable: { - AnalVTableDescription vtable = attr.data.value(); + AnalysisVTableDescription vtable = attr.data.value(); switch (role) { case Qt::DisplayRole: switch (index.column()) { @@ -619,7 +619,7 @@ void ClassesWidget::refreshClasses() proxy_model->setSourceModel(nullptr); delete bin_model; bin_model = nullptr; - analysis_model = new AnalClassesModel(this); + analysis_model = new AnalysisClassesModel(this); proxy_model->setSourceModel(analysis_model); } break; @@ -674,8 +674,8 @@ void ClassesWidget::showContextMenu(const QPoint &pt) QString className = index.parent().data(ClassesModel::NameRole).toString(); QString methodName = index.data(ClassesModel::NameRole).toString(); - AnalMethodDescription desc; - if (Core()->getAnalMethod(className, methodName, &desc)) { + AnalysisMethodDescription desc; + if (Core()->getAnalysisMethod(className, methodName, &desc)) { if (desc.vtableOffset >= 0) { menu.addAction(ui->seekToVTableAction); } @@ -690,7 +690,7 @@ void ClassesWidget::on_seekToVTableAction_triggered() QModelIndex index = ui->classesTreeView->selectionModel()->currentIndex(); QString className = index.parent().data(ClassesModel::NameRole).toString(); - QList vtables = Core()->getAnalClassVTables(className); + QList vtables = Core()->getAnalysisClassVTables(className); if (vtables.isEmpty()) { QMessageBox::warning(this, tr("Missing VTable in class"), tr("The class %1 does not have any VTable!").arg(className)); @@ -698,8 +698,8 @@ void ClassesWidget::on_seekToVTableAction_triggered() } QString methodName = index.data(ClassesModel::NameRole).toString(); - AnalMethodDescription desc; - if (!Core()->getAnalMethod(className, methodName, &desc) || desc.vtableOffset < 0) { + AnalysisMethodDescription desc; + if (!Core()->getAnalysisMethod(className, methodName, &desc) || desc.vtableOffset < 0) { return; } diff --git a/src/widgets/ClassesWidget.h b/src/widgets/ClassesWidget.h index 206446cb..cbd3fcad 100644 --- a/src/widgets/ClassesWidget.h +++ b/src/widgets/ClassesWidget.h @@ -90,7 +90,7 @@ public: void setClasses(const QList &classes); }; -class AnalClassesModel : public ClassesModel +class AnalysisClassesModel : public ClassesModel { Q_OBJECT @@ -145,7 +145,7 @@ private: QVariant data(const QModelIndex &index, int role) const override; public: - explicit AnalClassesModel(CutterDockWidget *parent); + explicit AnalysisClassesModel(CutterDockWidget *parent); public slots: void refreshAll(); @@ -198,7 +198,7 @@ private: std::unique_ptr ui; BinClassesModel *bin_model = nullptr; - AnalClassesModel *analysis_model = nullptr; + AnalysisClassesModel *analysis_model = nullptr; ClassesSortFilterProxyModel *proxy_model; };