From f9ac7495ac089f32b1712e5500cf2cd0c426c5dc Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 29 Apr 2025 16:05:54 -0400 Subject: Memory map UI improvements --- ui/memorymap.h | 26 ++++++++++++++++++++++++++ ui/uitypes.h | 1 + 2 files changed, 27 insertions(+) diff --git a/ui/memorymap.h b/ui/memorymap.h index f96f26c0..9fdab8be 100644 --- a/ui/memorymap.h +++ b/ui/memorymap.h @@ -35,6 +35,30 @@ public: virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; }; +/*! + + \ingroup memorymap +*/ +class BINARYNINJAUIAPI MemoryRegionDialog : public QDialog +{ + QPushButton* m_selectFileButton; + QPushButton* m_acceptButton; + QPushButton* m_cancelButton; + QLineEdit* m_nameField; + QLineEdit* m_startField; + QLineEdit* m_endField; + QLabel* m_contentsLabel; + + BinaryViewRef m_data; + SegmentRef m_segment; + std::optional m_filePath; + + void SelectFile(); + void Submit(); +public: + MemoryRegionDialog(QWidget* parent, BinaryViewRef data, SegmentRef associatedSegment = nullptr); +}; + /*! \ingroup memorymap @@ -92,6 +116,7 @@ enum class SegmentColumn : int { DATA_LENGTH, FLAGS, SOURCE, + REGION, COLUMN_COUNT, }; @@ -142,6 +167,7 @@ class BINARYNINJAUIAPI SegmentWidget : public QWidget QMenu* createHeaderContextMenu(const QPoint& p); void restoreDefaults(); + void addMemoryRegion(SegmentRef segment); void addSegment(); void editSegment(SegmentRef segment); void disableSegment(SegmentRef segment); diff --git a/ui/uitypes.h b/ui/uitypes.h index a520dbbe..89d2bdcd 100644 --- a/ui/uitypes.h +++ b/ui/uitypes.h @@ -99,6 +99,7 @@ typedef BinaryNinja::Ref ScriptingProviderRef; typedef BinaryNinja::Ref SecretsProviderRef; typedef BinaryNinja::Ref SectionRef; typedef BinaryNinja::Ref SegmentRef; +typedef BinaryNinja::Ref MemoryMapRef; typedef BinaryNinja::Ref SettingsRef; typedef BinaryNinja::Ref SnapshotRef; typedef BinaryNinja::Ref StructureRef; -- cgit v1.3.1