From 73b649e79d5cd219cb56866abf2ee5e6a64d976a Mon Sep 17 00:00:00 2001 From: Chinmay Date: Mon, 17 Aug 2020 22:53:09 -0700 Subject: UI changes for user-informed dataflow --- ui/possiblevaluesetdialog.h | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ui/possiblevaluesetdialog.h (limited to 'ui/possiblevaluesetdialog.h') diff --git a/ui/possiblevaluesetdialog.h b/ui/possiblevaluesetdialog.h new file mode 100644 index 00000000..5b5550a3 --- /dev/null +++ b/ui/possiblevaluesetdialog.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include "binaryninjaapi.h" +#include "dialogtextedit.h" +#include "clickablelabel.h" + +class BINARYNINJAUIAPI PossibleValueSetDialog: public QDialog +{ + Q_OBJECT + + QComboBox* m_combo; + QLineEdit* m_value; + QStringListModel* m_model; + QLabel* m_prompt; + QString m_promptText; + ClickableLabel* m_valueLabel; + BinaryViewRef m_view; + bool m_resultValid; + QStringList m_historyEntries; + int m_historySize; + QFont m_defaultFont; + bool m_initialTextSelection; + BinaryNinja::PossibleValueSet m_valueSet; + QPushButton* m_acceptButton; + QPalette m_defaultPalette; + QString m_parseError; + uint64_t m_here; + QTimer* m_updateTimer; + +private Q_SLOTS: + void accepted(); + void checkParse(); + void updateTimerEvent(); + void showHelp(); + void stateChanged(const QString&); + +public: + PossibleValueSetDialog(QWidget* parent, BinaryViewRef view, uint64_t here); + BinaryNinja::PossibleValueSet getPossibleValueSet() const { return m_valueSet; } + static BNRegisterValueType getRegisterValueTypeFromString(const std::string& stateStr); +}; + +static const QStringList valueSets = { + "ConstantValue", + "ConstantPointerValue", + "StackFrameOffset", + "SignedRangeValue", + "UnsignedRangeValue", + "InSetOfValues", + "NotInSetOfValues", + "UndeterminedValue", +}; -- cgit v1.3.1