2017-03-29 10:18:37 +00:00
|
|
|
#ifndef MEMORYWIDGET_H
|
|
|
|
#define MEMORYWIDGET_H
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QTextEdit>
|
|
|
|
#include <QDockWidget>
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QTabWidget>
|
2017-04-12 16:49:01 +00:00
|
|
|
#include <QWebEngineView>
|
2017-03-29 10:18:37 +00:00
|
|
|
#include <QUrl>
|
|
|
|
#include <QPlainTextEdit>
|
|
|
|
#include <QMouseEvent>
|
2017-09-25 12:55:41 +00:00
|
|
|
#include "cutter.h"
|
2017-10-01 19:09:42 +00:00
|
|
|
#include "utils/Highlighter.h"
|
|
|
|
#include "utils/HexAsciiHighlighter.h"
|
|
|
|
#include "utils/HexHighlighter.h"
|
2017-04-13 15:14:02 +00:00
|
|
|
#include "dashboard.h"
|
2017-09-28 21:53:59 +00:00
|
|
|
#include "widgets/DisassemblerGraphView.h"
|
2017-04-13 15:14:02 +00:00
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
class MainWindow;
|
|
|
|
|
2017-04-09 19:55:06 +00:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class MemoryWidget;
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
2017-04-13 15:14:02 +00:00
|
|
|
class MemoryWidget : public DockWidget
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-04-09 13:27:46 +00:00
|
|
|
explicit MemoryWidget(MainWindow *main);
|
2017-03-29 10:18:37 +00:00
|
|
|
~MemoryWidget();
|
|
|
|
|
2017-04-13 15:14:02 +00:00
|
|
|
void setup() override;
|
|
|
|
|
|
|
|
void refresh() override;
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
MainWindow *main;
|
|
|
|
QPlainTextEdit *disasTextEdit;
|
|
|
|
QTextEdit *hexOffsetText;
|
|
|
|
QPlainTextEdit *hexDisasTextEdit;
|
|
|
|
QTextEdit *hexASCIIText;
|
|
|
|
QTextEdit *hexHexText;
|
|
|
|
QTreeWidget *xrefToTreeWidget_2;
|
|
|
|
QTreeWidget *xreFromTreeWidget_2;
|
|
|
|
QTabWidget *memTabWidget;
|
2017-04-12 16:49:01 +00:00
|
|
|
QWebEngineView *graphWebView;
|
|
|
|
QWebEngineView *histoWebView;
|
2017-09-28 21:53:59 +00:00
|
|
|
DisassemblerGraphView *mGraphView;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
Highlighter *highlighter;
|
|
|
|
Highlighter *highlighter_5;
|
|
|
|
AsciiHighlighter *ascii_highlighter;
|
|
|
|
HexHighlighter *hex_highlighter;
|
|
|
|
Highlighter *preview_highlighter;
|
|
|
|
Highlighter *deco_highlighter;
|
|
|
|
|
2017-04-13 15:14:02 +00:00
|
|
|
signals:
|
|
|
|
void fontChanged(QFont font);
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
public slots:
|
2017-05-13 18:09:36 +00:00
|
|
|
void fillPlugins();
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
void addTextDisasm(QString txt);
|
|
|
|
|
|
|
|
void replaceTextDisasm(QString txt);
|
|
|
|
|
2017-07-11 11:05:42 +00:00
|
|
|
void refreshDisasm();
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-04-12 20:44:05 +00:00
|
|
|
void refreshHexdump(const QString &where = QString());
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-06-07 19:35:38 +00:00
|
|
|
void fill_refs(QList<XrefDescription> refs, QList<XrefDescription> xrefs, QList<int> graph_data);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
void fillOffsetInfo(QString off);
|
|
|
|
|
2017-04-12 20:44:05 +00:00
|
|
|
void seek_to(const QString &offset);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
void create_graph(QString off);
|
|
|
|
|
|
|
|
QString normalize_addr(QString addr);
|
|
|
|
|
2017-04-06 10:14:28 +00:00
|
|
|
QString normalizeAddr(QString addr);
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
void setMiniGraph(QString at);
|
|
|
|
|
|
|
|
void switchTheme(bool dark);
|
|
|
|
|
|
|
|
void highlightDisasms();
|
|
|
|
|
2017-03-30 09:27:43 +00:00
|
|
|
void selectHexPreview();
|
|
|
|
|
2017-04-05 14:03:36 +00:00
|
|
|
void frameLoadFinished(bool ok);
|
|
|
|
|
2017-07-11 11:05:42 +00:00
|
|
|
void updateViews(RVA offset = RVA_INVALID);
|
2017-04-11 11:41:44 +00:00
|
|
|
|
2017-09-01 13:03:35 +00:00
|
|
|
void showOffsets(bool show);
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
protected:
|
2017-04-10 10:25:33 +00:00
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
2017-03-30 22:33:29 +00:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MemoryWidget *ui;
|
|
|
|
|
|
|
|
ut64 hexdumpTopOffset;
|
|
|
|
ut64 hexdumpBottomOffset;
|
|
|
|
QString last_fcn;
|
2017-04-28 13:09:40 +00:00
|
|
|
|
2017-07-11 11:05:42 +00:00
|
|
|
RVA disasm_top_offset;
|
|
|
|
RVA next_disasm_top_offset;
|
|
|
|
|
2017-04-28 13:09:40 +00:00
|
|
|
RVA last_graph_fcn;
|
|
|
|
RVA last_hexdump_fcn;
|
|
|
|
|
|
|
|
void setFcnName(RVA addr);
|
2017-06-07 19:35:38 +00:00
|
|
|
void get_refs_data(RVA addr);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-04-13 15:14:02 +00:00
|
|
|
void setScrollMode();
|
|
|
|
|
2017-07-11 11:05:42 +00:00
|
|
|
bool loadMoreDisassembly();
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
private slots:
|
2017-07-11 11:05:42 +00:00
|
|
|
void on_globalSeekTo(RVA addr);
|
2017-04-28 13:38:01 +00:00
|
|
|
void on_cursorAddressChanged(RVA addr);
|
2017-04-28 13:09:40 +00:00
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
void highlightCurrentLine();
|
|
|
|
|
|
|
|
void highlightHexCurrentLine();
|
|
|
|
void highlightPreviewCurrentLine();
|
|
|
|
void highlightDecoCurrentLine();
|
2017-07-11 11:05:42 +00:00
|
|
|
RVA readCurrentDisassemblyOffset();
|
2017-03-29 10:18:37 +00:00
|
|
|
void setFonts(QFont font);
|
|
|
|
|
2017-04-28 13:38:01 +00:00
|
|
|
void highlightHexWords(const QString &str);
|
2017-03-29 10:18:37 +00:00
|
|
|
void on_showInfoButton_2_clicked();
|
|
|
|
void on_actionSettings_menu_1_triggered();
|
|
|
|
void on_actionHideDisasm_side_panel_triggered();
|
|
|
|
void on_actionHideHexdump_side_panel_triggered();
|
|
|
|
void on_actionHideGraph_side_panel_triggered();
|
|
|
|
void on_disButton_2_clicked();
|
|
|
|
void on_hexButton_2_clicked();
|
|
|
|
void on_graphButton_2_clicked();
|
2017-09-28 21:53:59 +00:00
|
|
|
void on_graphButton_clicked();
|
2017-03-29 10:18:37 +00:00
|
|
|
void showDisasContextMenu(const QPoint &pt);
|
|
|
|
void showHexdumpContextMenu(const QPoint &pt);
|
|
|
|
void showHexASCIIContextMenu(const QPoint &pt);
|
|
|
|
void on_actionSend_to_Notepad_triggered();
|
|
|
|
void on_actionDisasAdd_comment_triggered();
|
2017-07-11 11:05:42 +00:00
|
|
|
void on_actionAddFlag_triggered();
|
2017-03-29 10:18:37 +00:00
|
|
|
void on_actionFunctionsRename_triggered();
|
|
|
|
|
|
|
|
void on_hexHexText_2_selectionChanged();
|
|
|
|
void on_hexArchComboBox_2_currentTextChanged(const QString &arg1);
|
|
|
|
void on_hexBitsComboBox_2_currentTextChanged(const QString &arg1);
|
|
|
|
|
|
|
|
void on_action1column_triggered();
|
|
|
|
void on_action2columns_triggered();
|
|
|
|
void on_action4columns_triggered();
|
|
|
|
void on_action8columns_triggered();
|
|
|
|
void on_action16columns_triggered();
|
|
|
|
void on_action32columns_triggered();
|
|
|
|
void on_action64columns_triggered();
|
|
|
|
|
|
|
|
void disasmScrolled();
|
|
|
|
void resizeHexdump();
|
|
|
|
void hexScrolled();
|
2017-04-12 20:44:05 +00:00
|
|
|
QList<QString> get_hexdump(const QString &offset);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-06-08 22:40:43 +00:00
|
|
|
void showXrefsDialog();
|
2017-03-29 10:18:37 +00:00
|
|
|
//void showDisas();
|
2017-06-08 22:40:43 +00:00
|
|
|
//void showHexdump();
|
2017-03-29 10:18:37 +00:00
|
|
|
//void showGraph();
|
|
|
|
void cycleViews();
|
|
|
|
void on_xreFromTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
|
|
|
void on_xrefToTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
|
|
|
void on_xrefFromToolButton_2_clicked();
|
|
|
|
void on_xrefToToolButton_2_clicked();
|
|
|
|
void on_codeCombo_2_currentTextChanged(const QString &arg1);
|
|
|
|
void on_disasTextEdit_2_cursorPositionChanged();
|
|
|
|
void on_offsetToolButton_clicked();
|
|
|
|
void on_polarToolButton_clicked();
|
|
|
|
void on_radarToolButton_clicked();
|
|
|
|
void on_hexSideTab_2_currentChanged(int index);
|
|
|
|
void on_memSideToolButton_clicked();
|
|
|
|
void on_previewToolButton_clicked();
|
|
|
|
void on_decoToolButton_clicked();
|
|
|
|
void on_previewToolButton_2_clicked();
|
|
|
|
void on_actionXRefs_triggered();
|
|
|
|
void on_copyMD5_clicked();
|
|
|
|
void on_copySHA1_clicked();
|
|
|
|
void on_simpleGrapgToolButton_clicked();
|
2017-04-05 09:35:19 +00:00
|
|
|
void seek_back();
|
2017-04-11 11:41:44 +00:00
|
|
|
void on_memTabWidget_currentChanged(int index);
|
2017-03-29 10:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MEMORYWIDGET_H
|