2015-02-24 14:00:19 +00:00
|
|
|
|
#ifndef nesca_3_H
|
|
|
|
|
#define nesca_3_H
|
|
|
|
|
|
2015-03-07 17:31:48 +00:00
|
|
|
|
//Include windows.h ONLY *after* qdatetime.h
|
|
|
|
|
//Bug: https://bugreports.qt.io/browse/QTBUG-31469
|
|
|
|
|
|
|
|
|
|
#include <qdatetime.h>
|
2015-02-24 14:00:19 +00:00
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <qapplication.h>
|
|
|
|
|
#include <qgraphicsitem.h>
|
|
|
|
|
#include <QGraphicsView>
|
|
|
|
|
#include <QGraphicsScene>
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
|
#include "ui_nesca_3.h"
|
2015-02-24 14:14:32 +00:00
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
#include <QtGui/qevent.h>
|
2015-02-24 14:00:19 +00:00
|
|
|
|
#include <qthread.h>
|
|
|
|
|
#include <qjsonobject.h>
|
|
|
|
|
#include <qjsonvalue.h>
|
|
|
|
|
#include <qjsonarray.h>
|
|
|
|
|
#include <qtextcodec.h>
|
|
|
|
|
#include <qjsondocument.h>
|
2015-02-24 14:14:32 +00:00
|
|
|
|
#include <libssh/libssh.h>
|
|
|
|
|
#include <mainResources.h>
|
2015-02-24 14:00:19 +00:00
|
|
|
|
|
|
|
|
|
extern Ui::nesca_3Class *ui;
|
2015-03-06 14:32:36 +00:00
|
|
|
|
extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK, QOSWait,
|
2015-02-24 14:00:19 +00:00
|
|
|
|
connectedToIRC, ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag,
|
|
|
|
|
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
|
|
|
|
|
extern float QoSStep;
|
|
|
|
|
extern int MaxDataVal;
|
|
|
|
|
extern char endIP2[128], inputStr[256];
|
|
|
|
|
extern SOCKET lSock;
|
|
|
|
|
|
|
|
|
|
extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst;
|
|
|
|
|
extern QList<int> lstOfLabels;
|
|
|
|
|
extern QSystemTrayIcon *tray;
|
|
|
|
|
|
|
|
|
|
extern void ShowMsgPopup(QString str);
|
|
|
|
|
|
|
|
|
|
class nesca_3 : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
nesca_3(QWidget *parent = 0);
|
|
|
|
|
~nesca_3();
|
|
|
|
|
|
|
|
|
|
void ConnectEvrthng();
|
|
|
|
|
void ChangeLabelIpRange_Value(QString str);
|
|
|
|
|
void ChangeLabelIPS_Value(QString str);
|
|
|
|
|
void newListItem(QString str);
|
|
|
|
|
static int perc;
|
|
|
|
|
private:
|
2015-03-10 14:35:50 +00:00
|
|
|
|
int savedTabIndex;
|
2015-02-24 14:00:19 +00:00
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject* obj, QEvent *event);
|
|
|
|
|
void run();
|
|
|
|
|
|
|
|
|
|
QString GetSSLContent(QString str);
|
|
|
|
|
void SSLConnect(QString str);
|
|
|
|
|
protected slots:
|
|
|
|
|
void MaxBrutingThr_ChangeValue(QString str);
|
|
|
|
|
void ThreadDelay_ChangeValue(QString val);
|
|
|
|
|
void ChangePingerOK(bool val);
|
|
|
|
|
void changeNSTrackLabel(bool status);
|
|
|
|
|
void slotPBUpdate();
|
2015-02-27 13:55:35 +00:00
|
|
|
|
void DNSLine_ValueChanged();
|
2015-02-24 14:00:19 +00:00
|
|
|
|
void slotChangeCPModeToUTF();
|
|
|
|
|
void slotChangeCPModeTo1251();
|
|
|
|
|
void slotShowRedVersion();
|
|
|
|
|
void ChangeDebugFileState(bool val);
|
|
|
|
|
void ChangeTopic();
|
|
|
|
|
void slotIRCGetTopic(QString str);
|
|
|
|
|
void slotIRCOfflined();
|
|
|
|
|
void slotUnhidePopup(QString str, QString senderNick);
|
|
|
|
|
void slotItemClicked(QListWidgetItem* wi);
|
|
|
|
|
void slotClearNickList();
|
|
|
|
|
void slotAppendIRCNick(QString str);
|
|
|
|
|
void slotShowNicks();
|
|
|
|
|
void slotBlinkMessage();
|
2015-03-10 14:35:50 +00:00
|
|
|
|
void slotTabChanged(int index);
|
2015-02-24 14:00:19 +00:00
|
|
|
|
void IPScanSeq();
|
|
|
|
|
void DNSScanSeq();
|
|
|
|
|
void ImportScanSeq();
|
|
|
|
|
void smReaction();
|
|
|
|
|
void slotShowDataflow();
|
2015-03-10 20:09:05 +00:00
|
|
|
|
void slotOutData(QString str);
|
2015-02-24 14:00:19 +00:00
|
|
|
|
void slotIncData(QString ip, QString str);
|
|
|
|
|
void slotShowServerMsg(QString str);
|
2015-03-10 14:35:50 +00:00
|
|
|
|
void slotSaveImage();
|
2015-02-24 14:00:19 +00:00
|
|
|
|
void slotUpdatePie();
|
|
|
|
|
void slotClearLogs();
|
|
|
|
|
void slotRestartIRC();
|
|
|
|
|
void slotDrawVoiceGrid(int factor);
|
|
|
|
|
void slotDrawTextPlacers();
|
|
|
|
|
void onLinkClicked(QUrl link);
|
|
|
|
|
void CheckPersKey();
|
|
|
|
|
void CheckPersKey(int val);
|
|
|
|
|
void slotRestoreDefPorts();
|
|
|
|
|
void ChangeNick();
|
|
|
|
|
void setNickBox(QString str);
|
|
|
|
|
void SaySmthng();
|
|
|
|
|
void ChangeIRCRawLog();
|
|
|
|
|
void switchToJobMode();
|
|
|
|
|
void ConnectToIRCServer();
|
|
|
|
|
void CheckProxy();
|
|
|
|
|
void ChangeDispalyMode();
|
|
|
|
|
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 appendDebugText(QString str);
|
|
|
|
|
void appendNotifyText(QString str);
|
|
|
|
|
void appendDefaultText(QString str);
|
|
|
|
|
void appendRedIRCText(QString str);
|
|
|
|
|
void appendGreenIRCText(QString str);
|
|
|
|
|
void appendYellowIRCText(QString str);
|
2015-02-27 13:55:35 +00:00
|
|
|
|
void appendDefaultIRCText(bool, bool, QString str, QString s);
|
2015-02-24 14:00:19 +00:00
|
|
|
|
void appendDefaultIRCTextOut(QString str);
|
|
|
|
|
void appendDefaultIRCRawTextInc(QString str);
|
|
|
|
|
void appendDefaultIRCRawTextOut(QString str);
|
|
|
|
|
void appendGreenBAData(QString str);
|
|
|
|
|
void appendRedBAData(QString str);
|
|
|
|
|
void STTTerminate();
|
|
|
|
|
void playFcknSound();
|
|
|
|
|
private:
|
|
|
|
|
QPoint dragPosition;
|
|
|
|
|
};
|
|
|
|
|
class PieStatView : public QGraphicsView
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
PieStatView(QWidget *parent = 0) : QGraphicsView(parent) {};
|
|
|
|
|
public:
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
|
};
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
disableBlink = true;
|
|
|
|
|
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();
|
|
|
|
|
}
|
2015-02-24 14:14:32 +00:00
|
|
|
|
void mouseReleaseEvent()
|
2015-02-24 14:00:19 +00:00
|
|
|
|
{
|
|
|
|
|
if(switchWindows)
|
|
|
|
|
{
|
|
|
|
|
switchWindows = false;
|
|
|
|
|
emit ui->IRCModeBut->clicked();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QPoint oldPos;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // nesca_3_H
|
|
|
|
|
|