cutter/src/menus/DisassemblyContextMenu.h

144 lines
4.0 KiB
C
Raw Normal View History

#ifndef DISASSEMBLYCONTEXTMENU_H
#define DISASSEMBLYCONTEXTMENU_H
2018-03-04 17:42:02 +00:00
#include "Cutter.h"
#include <QMenu>
#include <QKeySequence>
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
public:
2017-11-19 17:49:29 +00:00
DisassemblyContextMenu(QWidget *parent = nullptr);
~DisassemblyContextMenu();
2017-12-02 15:43:21 +00:00
signals:
void copy();
public slots:
void setOffset(RVA offset);
2017-12-02 15:43:21 +00:00
void setCanCopy(bool enabled);
2017-11-28 13:50:41 +00:00
private slots:
void aboutToShowSlot();
void on_actionEditInstruction_triggered();
void on_actionNopInstruction_triggered();
void on_actionJmpReverse_triggered();
void showReverseJmpQuery();
void on_actionEditBytes_triggered();
2017-12-02 15:43:21 +00:00
void on_actionCopy_triggered();
void on_actionCopyAddr_triggered();
void on_actionAddComment_triggered();
void on_actionAnalyzeFunction_triggered();
void on_actionAddFlag_triggered();
void on_actionRename_triggered();
2017-11-30 14:16:39 +00:00
void on_actionRenameUsedHere_triggered();
void on_actionXRefs_triggered();
void on_actionDisplayOptions_triggered();
void on_actionDeleteComment_triggered();
void on_actionDeleteFlag_triggered();
void on_actionDeleteFunction_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
2018-08-04 18:05:56 +00:00
void on_actionSetToCode_triggered();
void on_actionSetToData_triggered();
void on_actionSetToDataEx_triggered();
private:
2017-12-02 15:43:21 +00:00
QKeySequence getCopySequence() const;
QKeySequence getCommentSequence() const;
2018-08-04 18:05:56 +00:00
QKeySequence getSetToCodeSequence() const;
QKeySequence getSetToDataSequence() const;
QKeySequence getSetToDataExSequence() const;
QKeySequence getAddFlagSequence() const;
QKeySequence getRenameSequence() const;
2017-11-30 14:16:39 +00:00
QKeySequence getRenameUsedHereSequence() const;
QKeySequence getXRefSequence() const;
QKeySequence getDisplayOptionsSequence() const;
QList<QKeySequence> getAddBPSequence() const;
2017-11-19 17:49:29 +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;
QMenu *editMenu;
QAction actionEditInstruction;
QAction actionNopInstruction;
QAction actionJmpReverse;
QAction actionEditBytes;
2017-12-02 15:43:21 +00:00
QAction actionCopy;
QAction *copySeparator;
QAction actionCopyAddr;
QAction actionAddComment;
QAction actionAddFlag;
QMenu *analyzeMenu;
QAction actionAnalyzeFunction;
QAction actionRename;
2017-11-30 14:16:39 +00:00
QAction actionRenameUsedHere;
QAction actionXRefs;
QAction actionDisplayOptions;
QAction actionDeleteComment;
QAction actionDeleteFlag;
QAction actionDeleteFunction;
2017-11-28 13:50:41 +00:00
QMenu *setBaseMenu;
QAction actionSetBaseBinary;
QAction actionSetBaseOctal;
QAction actionSetBaseDecimal;
QAction actionSetBaseHexadecimal;
QAction actionSetBasePort;
QAction actionSetBaseIPAddr;
QAction actionSetBaseSyscall;
QAction actionSetBaseString;
2018-02-12 09:48:06 +00:00
QMenu *setBitsMenu;
QAction actionSetBits16;
QAction actionSetBits32;
QAction actionSetBits64;
2018-06-12 08:43:14 +00:00
QMenu *debugMenu;
QAction actionContinueUntil;
QAction actionAddBreakpoint;
QAction actionSetPC;
2018-08-04 18:05:56 +00:00
QAction actionSetToCode;
QMenu *setToDataMenu;
QAction actionSetToDataEx;
QAction actionSetToDataByte;
QAction actionSetToDataWord;
QAction actionSetToDataDword;
QAction actionSetToDataQword;
// For creating anonymous entries (that are always visible)
2018-08-04 18:05:56 +00:00
QAction *addAnonymousAction(QString name, const char *slot, QKeySequence shortcut);
void initAction(QAction *action, QString name, const char *slot = nullptr);
void initAction(QAction *action, QString name, const char *slot, QKeySequence keySequence);
void initAction(QAction *action, QString name, const char *slot, QList<QKeySequence> keySequence);
void setBase(QString base);
void setToData(int size, int repeat = 1);
void setBits(int bits);
void addAnalyzeMenu();
2018-08-04 18:05:56 +00:00
void addSetBaseMenu();
void addSetBitsMenu();
void addSetToDataMenu();
void addEditMenu();
void addDebugMenu();
};
#endif // DISASSEMBLYCONTEXTMENU_H