2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
#ifndef HEXDUMPWIDGET_H
|
|
|
|
#define HEXDUMPWIDGET_H
|
|
|
|
|
2017-11-16 21:12:44 +00:00
|
|
|
#include <array>
|
2017-10-12 19:55:15 +00:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QTextEdit>
|
|
|
|
#include <QDockWidget>
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QUrl>
|
|
|
|
#include <QPlainTextEdit>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <memory>
|
|
|
|
#include "cutter.h"
|
|
|
|
#include "utils/Highlighter.h"
|
|
|
|
#include "utils/HexAsciiHighlighter.h"
|
|
|
|
#include "utils/HexHighlighter.h"
|
|
|
|
#include "Dashboard.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class HexdumpWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class HexdumpWidget : public QDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit HexdumpWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
|
|
explicit HexdumpWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
|
|
~HexdumpWidget();
|
|
|
|
|
|
|
|
Highlighter *highlighter;
|
|
|
|
|
2017-11-19 21:21:02 +00:00
|
|
|
//signals:
|
|
|
|
// void fontChanged(QFont font);
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void fillPlugins();
|
|
|
|
|
|
|
|
QString normalize_addr(QString addr);
|
|
|
|
|
|
|
|
QString normalizeAddr(QString addr);
|
|
|
|
|
|
|
|
void selectHexPreview();
|
|
|
|
|
|
|
|
void showOffsets(bool show);
|
|
|
|
|
2017-11-08 13:17:24 +00:00
|
|
|
void zoomIn(int range = 1);
|
|
|
|
void zoomOut(int range = 1);
|
|
|
|
|
2017-10-12 19:55:15 +00:00
|
|
|
protected:
|
2017-11-08 13:17:24 +00:00
|
|
|
virtual void resizeEvent(QResizeEvent *event) override;
|
|
|
|
virtual void wheelEvent(QWheelEvent* event) override;
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-17 12:41:30 +00:00
|
|
|
static const int linesMarginMin;
|
|
|
|
static const int linesMarginDefault;
|
|
|
|
static const int linesMarginMax;
|
|
|
|
|
2017-10-12 19:55:15 +00:00
|
|
|
std::unique_ptr<Ui::HexdumpWidget> ui;
|
|
|
|
|
2017-11-15 21:42:39 +00:00
|
|
|
RVA topOffset;
|
|
|
|
RVA bottomOffset;
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
void refresh(RVA addr = RVA_INVALID);
|
2017-11-17 12:41:30 +00:00
|
|
|
void appendHexdumpLines(int lines, bool top);
|
|
|
|
void removeHexdumpLines(int lines, bool top);
|
2017-10-12 19:55:15 +00:00
|
|
|
|
2017-11-19 21:21:02 +00:00
|
|
|
void updateHeaders();
|
|
|
|
|
2017-11-16 21:12:44 +00:00
|
|
|
std::array<QString, 3> fetchHexdump(RVA offset, RVA bytes);
|
2017-11-15 21:56:10 +00:00
|
|
|
|
2017-11-17 12:41:30 +00:00
|
|
|
void connectScroll(bool disconnect);
|
2017-11-18 14:33:52 +00:00
|
|
|
void setupScrollSync();
|
2017-11-17 12:41:30 +00:00
|
|
|
|
2017-10-12 19:55:15 +00:00
|
|
|
private slots:
|
|
|
|
void on_seekChanged(RVA addr);
|
2017-11-04 11:46:29 +00:00
|
|
|
void raisePrioritizedMemoryWidget(CutterCore::MemoryWidgetType type);
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
void highlightHexCurrentLine();
|
2017-11-19 21:21:02 +00:00
|
|
|
void setFonts();
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
void highlightHexWords(const QString &str);
|
|
|
|
void on_actionSettings_menu_1_triggered();
|
|
|
|
void on_actionHideHexdump_side_panel_triggered();
|
|
|
|
|
|
|
|
void showHexdumpContextMenu(const QPoint &pt);
|
|
|
|
void showHexASCIIContextMenu(const QPoint &pt);
|
|
|
|
|
2017-11-16 21:12:44 +00:00
|
|
|
void on_hexHexText_selectionChanged();
|
2017-10-12 19:55:15 +00:00
|
|
|
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 resizeHexdump();
|
2017-11-19 14:09:48 +00:00
|
|
|
void adjustHexdumpLines();
|
2017-10-12 19:55:15 +00:00
|
|
|
|
|
|
|
void on_codeCombo_2_currentTextChanged(const QString &arg1);
|
|
|
|
void on_hexSideTab_2_currentChanged(int index);
|
|
|
|
void on_memSideToolButton_clicked();
|
|
|
|
void on_copyMD5_clicked();
|
|
|
|
void on_copySHA1_clicked();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // HEXDUMPWIDGET_H
|