diff options
| author | Peter LaFosse <peter@vector35.com> | 2023-03-07 15:50:59 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2023-03-07 17:02:12 -0500 |
| commit | dac3e9d89febf151ceb0804e3c22b00225ccbea9 (patch) | |
| tree | a6a622380d873dcc6000b46c01abb3df2d11c530 /ui/bndbimportdialog.h | |
| parent | 523dfb62220c3cbc82cd3b236b27c9216488ae3d (diff) | |
Add DataVariable and FunctionToImport features to BNDB Import Dialog
Diffstat (limited to 'ui/bndbimportdialog.h')
| -rw-r--r-- | ui/bndbimportdialog.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/ui/bndbimportdialog.h b/ui/bndbimportdialog.h index 86a81c96..37b46f31 100644 --- a/ui/bndbimportdialog.h +++ b/ui/bndbimportdialog.h @@ -8,7 +8,30 @@ #include <QtWidgets/QTextBrowser> #include <QtWidgets/QTreeWidget> #include <QtWidgets/QCheckBox> +#include <QtGui/QKeyEvent> + #include "uitypes.h" +#include "binaryninjaapi.h" + +constexpr int IndexRole = Qt::UserRole; +constexpr int ItemRole = Qt::UserRole + 1; +constexpr int LocationRole = Qt::UserRole + 2; +constexpr int NameColumn = 1; +constexpr int LocationColumn = 2; + + +class BackgroundTreeWidget : public QTreeWidget +{ + Q_OBJECT +public: + explicit BackgroundTreeWidget(QWidget *parent); + +Q_SIGNALS: + void addressDoubleClicked(uint64_t address); + +protected: + virtual void keyPressEvent(QKeyEvent* event) override; +}; /*! @@ -36,8 +59,16 @@ class BINARYNINJAUIAPI BndbImportDialog : public QDialog std::vector<BinaryNinja::QualifiedNameAndType> m_types; std::vector<SymbolAndType> m_functions; + std::vector<SymbolAndType> m_functionsToImports; std::vector<SymbolAndType> m_dataVariables; + enum ItemType { + TypeItem, + FunctionItem, + FunctionToImportItem, + DataVariableItem + }; + BinaryViewRef m_incomingView; LoggerRef m_logger; @@ -55,9 +86,13 @@ private: bool isExistingType(const BinaryNinja::QualifiedName& name, bool function) const; bool isBuiltinType(const BinaryNinja::QualifiedName& name) const; void ApplyFunctionTypes(const std::vector<SymbolAndType>& functions); + void ApplyFunctionTypesToImports(const std::vector<SymbolAndType>& functions); void ApplyDataVariables(const std::vector<SymbolAndType>& dataVariables); - + std::vector<SymbolRef> matchingSymbol(const SymbolRef sym, std::vector<BNSymbolType> allowed, bool allowPrefix); + void navigateToItem(QTreeWidgetItem *item, int column); + bool inSymbolBlackList(const SymbolRef sym); public: + BndbImportDialog(QWidget* parent, BinaryViewRef view); ~BndbImportDialog() = default; }; |
