-
Notifications
You must be signed in to change notification settings - Fork 79
/
nesca_3.h
270 lines (248 loc) · 6.81 KB
/
nesca_3.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#ifndef nesca_3_H
#define nesca_3_H
//Include windows.h ONLY *after* qdatetime.h
//Bug: https://bugreports.qt.io/browse/QTBUG-31469
#include <qdatetime.h>
#include <QMainWindow>
#include <qapplication.h>
#include <qgraphicsitem.h>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QSystemTrayIcon>
#include <QtGui/qevent.h>
#include <qthread.h>
#include <qtextcodec.h>
#if defined(WIN32)
#include <libssh/libssh.h>
#endif
#include <QStringListModel>
#include <QStandardItemModel>
#include <QList>
#include <ui_nesca_3.h>
extern Ui::nesca_3Class *ui;
extern bool widgetIsHidden, QOSWait,
ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag,
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1;
extern float QoSStep;
extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst;
extern QList<int> lstOfLabels;
extern QSystemTrayIcon *tray;
extern QStandardItemModel *BAModel;
class nesca_3 : public QMainWindow
{
Q_OBJECT
public:
nesca_3(bool isWM, QWidget *parent);
~nesca_3();
void ConnectEvrthng();
// void ChangeLabelIpRange_Value(QString str);
// void ChangeLabelIPS_Value(QString str);
// void newListItem(QString str);
static int addBARow(QString ip, QString loginPass, QString percentage);
bool etEventFilter(QObject* object, QEvent* event);
public:
static int perc;
static int savedTabIndex;
protected:
bool eventFilter(QObject* obj, QEvent *event);
void run();
QString GetSSLContent(QString str);
void SSLConnect(QString str);
protected slots:
void saveTLD(QString str);
void onLinkClicked(QUrl);
void MaxBrutingThr_ChangeValue(QString str);
void ThreadDelay_ChangeValue(QString val);
void ChangePingerOK(bool val);
void changeNSTrackLabel(bool status);
void DNSLine_ValueChanged();
void slotShowRedVersion();
void slotTabChanged(int index);
void IPScanSeq();
void DNSScanSeq();
void ImportScanSeq();
void smReaction();
void slotShowDataflow();
void slotOutData(QString str);
void slotIncData(QString ip, QString str);
void slotShowServerMsg(QString str);
void slotSaveImage(QAction *qwe);
void slotUpdatePie();
void slotClearLogs();
void slotDrawVoiceGrid(int factor);
void slotDrawTextPlacers();
// void CheckPersKey();
// bool CheckPersKeyMain();
void slotRestoreDefPorts();
void switchToJobMode();
void switchDataFields();
void importAndScan();
void slotQoSAddGrid();
void slotVoiceAddLine();
void slotDrawDelimLines();
void slotDrawActivityLine(QString data);
void slotDrawActivityGrid();
void activateME2ScanScene();
void activateQoSScanBut();
void activateVoiceScanBut();
void activatePieStatBut();
void slotAddPolyLine();
void slotQoSAddLine();
void slotAddLine(int x1, int y1, int x2, int y2);
void slotDrawGrid();
void exitButtonClicked();
void trayButtonClicked();
void mouseMoveEvent(QMouseEvent * event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void logoLabelClicked();
void startScanButtonClicked();
void startScanButtonClickedDNS();
void saveOptions();
void ChangeTrackerOK(bool val);
void ChangeShuffle(bool val);
void ChangeLabelThreads_ValueChanged(QString);
void PingTO_ChangeValue(QString);
void ChangeLabelTO_ValueChanged(QString);
void appendErrText(QString str);
void appendOKText(QString str);
void appendTextCustom(QString str, QString color);
void appendDebugText(QString str);
void appendNotifyText(QString str);
void appendDefaultText(QString str);
void STTTerminate();
void drawVerboseArcs(unsigned long gTargets);
void finishLoading();
void slotBlockButtons(bool value);
//BA TablelistView
void slotChangeBARow(const int index, const QString loginPass, const QString percentage);
void slotEditFilter();
private:
QPoint dragPosition;
};
class PieStatView : public QGraphicsView
{
Q_OBJECT
public:
PieStatView(QWidget *parent = 0) : QGraphicsView(parent) {};
public:
void contextMenuEvent(QContextMenuEvent *event);
};
class PekoWidget : public QWidget
{
Q_OBJECT;
public:
static int m_xPos;
static int m_yPos;
static int m_windowCounter;
static int offset;
PekoWidget(QWidget *parent = 0) : QWidget(parent)
{
}
PekoWidget(const int qmwXPos, const int qmwYPos, QWidget *parent = 0) : QWidget(parent)
{
offset = 5;
setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow);
installEventFilter(this);
setStyleSheet(
"background-color:qlineargradient(spread:pad, x1:0.541, y1:0.500364, x2:0.54, y2:0, stop:0 rgba(16, 16, 16, 255), stop:1 rgba(0, 0, 0, 255));");
if (m_xPos >= 1200) {
m_xPos = 305;
offset += 5;
}
setGeometry(qmwXPos - m_xPos, qmwYPos + m_yPos, 300, 200);
if (m_windowCounter++ < 3) {
m_yPos += 200 + offset;
}
else {
m_windowCounter = 0;
m_xPos += 305;
m_yPos = 0;
}
};
protected slots:
void pekoExitButtonClicked();
protected:
bool switchWindows;
void paintEvent(QPaintEvent *e)
{
QPainter painter(this);
painter.setPen(QColor(255, 255, 255, 60));
painter.drawRoundedRect(0, 0, width() - 1, height() - 1, 0, 1);
QWidget::paintEvent(e);
}
void mousePressEvent(QMouseEvent *evt)
{
switchWindows = false;
if (evt->button() == Qt::LeftButton)
{
switchWindows = true;
oldPos = evt->globalPos();
evt->accept();
}
else if (evt->button() == Qt::RightButton)
{
ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
this->close();
};
}
void mouseMoveEvent(QMouseEvent *evt)
{
switchWindows = false;
const QPoint delta = evt->globalPos() - oldPos;
move(x() + delta.x(), y() + delta.y());
oldPos = evt->globalPos();
}
void mouseReleaseEvent()
{
if (switchWindows)
{
switchWindows = false;
};
}
private:
QPoint oldPos;
};
class PopupMsgWidget : public QWidget
{
Q_OBJECT
public:
PopupMsgWidget(QWidget* parent = 0) : QWidget(parent)
{ };
public: signals: void clicked(bool checked = false);
protected:
bool switchWindows;
void mousePressEvent(QMouseEvent *evt)
{
switchWindows = false;
if (evt->button() == Qt::LeftButton)
{
switchWindows = true;
oldPos = evt->globalPos();
evt->accept();
}
else if (evt->button() == Qt::RightButton)
{
ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
this->hide();
};
}
void mouseMoveEvent(QMouseEvent *evt)
{
switchWindows = false;
const QPoint delta = evt->globalPos() - oldPos;
move(x()+delta.x(), y()+delta.y());
oldPos = evt->globalPos();
}
void mouseReleaseEvent()
{
if(switchWindows)
{
switchWindows = false;
};
}
private:
QPoint oldPos;
};
#endif // nesca_3_H