summaryrefslogtreecommitdiff
path: root/ui/addressdialog.h
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2021-05-05 17:23:49 +0800
committerXusheng <xusheng@vector35.com>2021-05-26 17:46:13 +0800
commit7c9ada78241e08bf36bd04d989f742a6de721575 (patch)
tree4134fd2f12a504ab17cc0b9acc1fb8d27552490f /ui/addressdialog.h
parentfd1974b407be042fd84f0267a328a5adabce28e1 (diff)
Add the ability to automatically create struct members
Diffstat (limited to 'ui/addressdialog.h')
-rw-r--r--ui/addressdialog.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/ui/addressdialog.h b/ui/addressdialog.h
index 557030ba..261f0732 100644
--- a/ui/addressdialog.h
+++ b/ui/addressdialog.h
@@ -89,4 +89,48 @@ public:
const QString& title = "Go to File Offset", const QString& prompt = "Enter Expression", bool defaultToCurrent = false);
~FileOffsetDialogWithPreview() {}
uint64_t getOffset() const { return m_fileOffset; }
+};
+
+class BINARYNINJAUIAPI AddUserXrefDialog: public QDialog
+{
+ Q_OBJECT
+
+ QComboBox* m_combo;
+ QStringListModel* m_model;
+ QLabel* m_previewText, m_sizePrompt;
+ QLineEdit* m_sizeInput;
+ BinaryViewRef m_view;
+ uint64_t m_addr;
+ uint64_t m_here;
+ size_t m_size;
+ bool m_resultValid;
+ QTimer* m_updateTimer;
+ QStringList m_historyEntries;
+ int m_historySize;
+ GetSymbolsListThread* m_updateThread;
+ QColor m_defaultColor;
+ QFont m_defaultFont;
+ QString m_prompt;
+ bool m_initialTextSelection;
+ std::string m_errorString;
+ bool m_resultAmbiguous;
+
+ void commitHistory();
+ void customEvent(QEvent* event);
+
+private Q_SLOTS:
+ void updateTimerEvent();
+ void accepted();
+ void updatePreview();
+ void updatePreviewText();
+ void updatePreviewWithText(QString data);
+
+public:
+ AddUserXrefDialog(QWidget* parent, BinaryViewRef view, uint64_t here = 0,
+ size_t size = 0, const QString& title = "Add User Type Field Cross Reference",
+ const QString& sizeTitle = "Size of Reference (optional)",
+ const QString& prompt = "Enter Expression", bool defaultToCurrent = false);
+ ~AddUserXrefDialog() { delete m_updateThread; }
+ uint64_t getOffset() const { return m_addr; }
+ size_t getSize() const { return m_size; }
}; \ No newline at end of file