2017-10-10 10:17:05 +00:00
|
|
|
#ifndef DISASSEMBLYCONTEXTMENU_H
|
|
|
|
#define DISASSEMBLYCONTEXTMENU_H
|
|
|
|
|
2018-03-04 17:42:02 +00:00
|
|
|
#include "Cutter.h"
|
2017-10-10 10:17:05 +00:00
|
|
|
#include <QMenu>
|
2017-11-03 11:31:20 +00:00
|
|
|
#include <QKeySequence>
|
2017-10-10 10:17:05 +00:00
|
|
|
|
2017-11-19 17:49:29 +00:00
|
|
|
class DisassemblyContextMenu : public QMenu
|
|
|
|
{
|
2018-03-21 20:32:32 +00:00
|
|
|
Q_OBJECT
|
2017-11-19 17:49:29 +00:00
|
|
|
|
2017-10-10 10:17:05 +00:00
|
|
|
public:
|
2017-11-19 17:49:29 +00:00
|
|
|
DisassemblyContextMenu(QWidget *parent = nullptr);
|
2017-12-10 20:40:15 +00:00
|
|
|
~DisassemblyContextMenu();
|
2017-11-03 11:31:20 +00:00
|
|
|
|
2017-12-02 15:43:21 +00:00
|
|
|
signals:
|
|
|
|
void copy();
|
|
|
|
|
2017-11-03 11:31:20 +00:00
|
|
|
public slots:
|
|
|
|
void setOffset(RVA offset);
|
2017-12-02 15:43:21 +00:00
|
|
|
void setCanCopy(bool enabled);
|
2017-11-03 11:31:20 +00:00
|
|
|
|
2017-11-28 13:50:41 +00:00
|
|
|
private slots:
|
|
|
|
void aboutToShowSlot();
|
|
|
|
|
2018-02-12 20:12:13 +00:00
|
|
|
void on_actionEditInstruction_triggered();
|
2018-03-05 14:20:55 +00:00
|
|
|
void on_actionNopInstruction_triggered();
|
2018-03-10 07:27:09 +00:00
|
|
|
void on_actionJmpReverse_triggered();
|
|
|
|
void showReverseJmpQuery();
|
2018-02-12 20:12:13 +00:00
|
|
|
void on_actionEditBytes_triggered();
|
|
|
|
|
2017-12-02 15:43:21 +00:00
|
|
|
void on_actionCopy_triggered();
|
2018-05-03 07:53:01 +00:00
|
|
|
void on_actionCopyAddr_triggered();
|
2017-11-03 11:31:20 +00:00
|
|
|
void on_actionAddComment_triggered();
|
2017-12-10 20:40:15 +00:00
|
|
|
void on_actionCreateFunction_triggered();
|
2017-11-03 11:31:20 +00:00
|
|
|
void on_actionAddFlag_triggered();
|
|
|
|
void on_actionRename_triggered();
|
2017-11-30 14:16:39 +00:00
|
|
|
void on_actionRenameUsedHere_triggered();
|
2017-11-03 11:31:20 +00:00
|
|
|
void on_actionXRefs_triggered();
|
|
|
|
void on_actionDisplayOptions_triggered();
|
2017-10-10 10:17:05 +00:00
|
|
|
|
2017-12-11 13:07:12 +00:00
|
|
|
void on_actionDeleteComment_triggered();
|
|
|
|
void on_actionDeleteFlag_triggered();
|
|
|
|
void on_actionDeleteFunction_triggered();
|
|
|
|
|
2017-11-28 13:13:22 +00:00
|
|
|
void on_actionSetBaseBinary_triggered();
|
|
|
|
void on_actionSetBaseOctal_triggered();
|
|
|
|
void on_actionSetBaseDecimal_triggered();
|
|
|
|
void on_actionSetBaseHexadecimal_triggered();
|
|
|
|
void on_actionSetBasePort_triggered();
|
|
|
|
void on_actionSetBaseIPAddr_triggered();
|
|
|
|
void on_actionSetBaseSyscall_triggered();
|
|
|
|
void on_actionSetBaseString_triggered();
|
|
|
|
|
2018-02-12 09:48:06 +00:00
|
|
|
void on_actionSetBits16_triggered();
|
|
|
|
void on_actionSetBits32_triggered();
|
|
|
|
void on_actionSetBits64_triggered();
|
2018-06-12 08:43:14 +00:00
|
|
|
void on_actionAddBreakpoint_triggered();
|
|
|
|
void on_actionContinueUntil_triggered();
|
|
|
|
void on_actionSetPC_triggered();
|
2018-02-12 09:48:06 +00:00
|
|
|
|
2017-11-03 11:31:20 +00:00
|
|
|
private:
|
2017-12-02 15:43:21 +00:00
|
|
|
QKeySequence getCopySequence() const;
|
2017-11-03 11:31:20 +00:00
|
|
|
QKeySequence getCommentSequence() const;
|
|
|
|
QKeySequence getAddFlagSequence() const;
|
|
|
|
QKeySequence getRenameSequence() const;
|
2017-11-30 14:16:39 +00:00
|
|
|
QKeySequence getRenameUsedHereSequence() const;
|
2017-11-03 11:31:20 +00:00
|
|
|
QKeySequence getXRefSequence() const;
|
|
|
|
QKeySequence getDisplayOptionsSequence() const;
|
2018-07-17 07:26:20 +00:00
|
|
|
QList<QKeySequence> getAddBPSequence() const;
|
2017-11-19 17:49:29 +00:00
|
|
|
|
2017-10-10 10:17:05 +00:00
|
|
|
RVA offset;
|
2017-12-02 15:43:21 +00:00
|
|
|
bool canCopy;
|
|
|
|
|
2018-03-21 20:32:32 +00:00
|
|
|
QList<QAction *> anonymousActions;
|
2017-12-10 20:40:15 +00:00
|
|
|
|
2018-02-12 20:12:13 +00:00
|
|
|
QMenu *editMenu;
|
|
|
|
QAction *editMenuAction;
|
|
|
|
QAction actionEditInstruction;
|
2018-03-05 14:20:55 +00:00
|
|
|
QAction actionNopInstruction;
|
2018-03-10 07:27:09 +00:00
|
|
|
QAction actionJmpReverse;
|
2018-02-12 20:12:13 +00:00
|
|
|
QAction actionEditBytes;
|
|
|
|
|
2017-12-02 15:43:21 +00:00
|
|
|
QAction actionCopy;
|
|
|
|
QAction *copySeparator;
|
2018-05-03 07:53:01 +00:00
|
|
|
QAction actionCopyAddr;
|
2017-12-10 20:40:15 +00:00
|
|
|
|
|
|
|
|
2017-10-10 10:17:05 +00:00
|
|
|
QAction actionAddComment;
|
|
|
|
QAction actionAddFlag;
|
2017-12-10 20:40:15 +00:00
|
|
|
QAction actionCreateFunction;
|
2017-10-10 10:17:05 +00:00
|
|
|
QAction actionRename;
|
2017-11-30 14:16:39 +00:00
|
|
|
QAction actionRenameUsedHere;
|
2017-10-10 10:17:05 +00:00
|
|
|
QAction actionXRefs;
|
|
|
|
QAction actionDisplayOptions;
|
2017-11-28 13:13:22 +00:00
|
|
|
|
2017-12-11 13:07:12 +00:00
|
|
|
QAction actionDeleteComment;
|
|
|
|
QAction actionDeleteFlag;
|
|
|
|
QAction actionDeleteFunction;
|
|
|
|
|
2017-11-28 13:50:41 +00:00
|
|
|
QMenu *setBaseMenu;
|
|
|
|
QAction *setBaseMenuAction;
|
2017-11-28 13:13:22 +00:00
|
|
|
QAction actionSetBaseBinary;
|
|
|
|
QAction actionSetBaseOctal;
|
|
|
|
QAction actionSetBaseDecimal;
|
|
|
|
QAction actionSetBaseHexadecimal;
|
|
|
|
QAction actionSetBasePort;
|
|
|
|
QAction actionSetBaseIPAddr;
|
|
|
|
QAction actionSetBaseSyscall;
|
|
|
|
QAction actionSetBaseString;
|
2017-12-10 20:40:15 +00:00
|
|
|
|
2018-02-12 09:48:06 +00:00
|
|
|
QMenu *setBitsMenu;
|
|
|
|
QAction *setBitsMenuAction;
|
|
|
|
QAction actionSetBits16;
|
|
|
|
QAction actionSetBits32;
|
|
|
|
QAction actionSetBits64;
|
|
|
|
|
2018-06-12 08:43:14 +00:00
|
|
|
QMenu *debugMenu;
|
|
|
|
QAction *debugMenuAction;
|
|
|
|
QAction actionContinueUntil;
|
|
|
|
QAction actionAddBreakpoint;
|
|
|
|
QAction actionSetPC;
|
|
|
|
|
2017-12-10 20:40:15 +00:00
|
|
|
// For creating anonymous entries (that are always visible)
|
|
|
|
void createAction(QString name, QKeySequence keySequence, const char *slot);
|
|
|
|
void createAction(QAction *action, QString name, QKeySequence keySequence, const char *slot);
|
2018-07-17 07:26:20 +00:00
|
|
|
void createAction(QMenu *menu, QAction *action, QString name, QList<QKeySequence> keySequence, const char *slot);
|
2017-10-10 10:17:05 +00:00
|
|
|
};
|
|
|
|
#endif // DISASSEMBLYCONTEXTMENU_H
|