Skip to content

Commit f9ac749

Browse files
committed
Memory map UI improvements
1 parent b0965fa commit f9ac749

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

ui/memorymap.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ class BINARYNINJAUIAPI MemoryMapItemDelegate : public QStyledItemDelegate
3535
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
3636
};
3737

38+
/*!
39+
40+
\ingroup memorymap
41+
*/
42+
class BINARYNINJAUIAPI MemoryRegionDialog : public QDialog
43+
{
44+
QPushButton* m_selectFileButton;
45+
QPushButton* m_acceptButton;
46+
QPushButton* m_cancelButton;
47+
QLineEdit* m_nameField;
48+
QLineEdit* m_startField;
49+
QLineEdit* m_endField;
50+
QLabel* m_contentsLabel;
51+
52+
BinaryViewRef m_data;
53+
SegmentRef m_segment;
54+
std::optional<std::string> m_filePath;
55+
56+
void SelectFile();
57+
void Submit();
58+
public:
59+
MemoryRegionDialog(QWidget* parent, BinaryViewRef data, SegmentRef associatedSegment = nullptr);
60+
};
61+
3862
/*!
3963
4064
\ingroup memorymap
@@ -92,6 +116,7 @@ enum class SegmentColumn : int {
92116
DATA_LENGTH,
93117
FLAGS,
94118
SOURCE,
119+
REGION,
95120
COLUMN_COUNT,
96121
};
97122

@@ -142,6 +167,7 @@ class BINARYNINJAUIAPI SegmentWidget : public QWidget
142167
QMenu* createHeaderContextMenu(const QPoint& p);
143168
void restoreDefaults();
144169

170+
void addMemoryRegion(SegmentRef segment);
145171
void addSegment();
146172
void editSegment(SegmentRef segment);
147173
void disableSegment(SegmentRef segment);

ui/uitypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ typedef BinaryNinja::Ref<BinaryNinja::ScriptingProvider> ScriptingProviderRef;
9999
typedef BinaryNinja::Ref<BinaryNinja::SecretsProvider> SecretsProviderRef;
100100
typedef BinaryNinja::Ref<BinaryNinja::Section> SectionRef;
101101
typedef BinaryNinja::Ref<BinaryNinja::Segment> SegmentRef;
102+
typedef BinaryNinja::Ref<BinaryNinja::MemoryMap> MemoryMapRef;
102103
typedef BinaryNinja::Ref<BinaryNinja::Settings> SettingsRef;
103104
typedef BinaryNinja::Ref<BinaryNinja::Snapshot> SnapshotRef;
104105
typedef BinaryNinja::Ref<BinaryNinja::Structure> StructureRef;

0 commit comments

Comments
 (0)