-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.h
104 lines (73 loc) · 2.43 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDesktopServices>
#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
#include <QString>
#include <QWindow>
#include <QLabel>
#include <QMovie>
#include <QTime>
#include <QDir>
#include "gdb.h"
//The output pages in the main window
enum outputTabs
{
Assembly = 0, Code, GDBOutput
};
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
int checkForArguments(QStringList args);
void showWelcome();
void showFileOpenedNotification(QString fileName);
QString configDirPath = QDir::homePath() + "/.config/Disass/";
~MainWindow();
private slots:
void updateOutput();
void on_sendButton_clicked();
void on_actionOpen_triggered();
void on_intelButton_clicked();
void on_atNtButton_clicked();
void on_breakButton_clicked();
void on_stepOverButton_clicked();
void on_stepIntoButton_clicked();
void on_nextCodeLineButton_clicked();
void on_continueButton_clicked();
void on_runButton_clicked();
void on_actionQuit_triggered();
void on_actionContribute_triggered();
void on_actionLicense_triggered();
void on_actionAbout_triggered();
void on_action64_Bit_triggered();
void on_action32_Bit_triggered();
void on_actionHow_to_Use_triggered();
void on_codeOutputTabs_currentChanged(int index);
void on_stopButton_clicked(bool clearGDB = true);
private:
Ui::MainWindow *ui;
GDB gdbInstance;
quint64 nStackWords = 28; //Default number of stack "words" to query from gdb
quint64 nInstructions = 20; //Default number of assembly instructions to query from gdb
quint64 nLines = 10; //Default number of code lines to query from gdb
QString currentLine;
//Add a config struct later on maybe?
QString configFilePath = configDirPath + "lastDirectory";
QString lastDirectoryPath; //The last directory an executable has been chosen from.
void setUIInteraction(bool state);
void retrieveGDBContext();
//Functions to parse the gdb output
void parseandSetRegistersOutput(QString registersOutput);
void parseandSetAssemblyOutput(QString assemblyOutput);
void parseandSetStackOutput(QString stackOutput);
void parseandSetCodeOutput(QString codeOutput);
void parseandSetCodeLine(QString codeFrameOutput);
};
#endif // MAINWINDOW_H