mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
Corrupted port-restore-string bug fixed
This commit is contained in:
parent
fdfd38b0f7
commit
0f072d68f3
70
nesca_3.cpp
70
nesca_3.cpp
@ -47,7 +47,6 @@ bool smBit_5 = false;
|
|||||||
bool smBit_6 = false;
|
bool smBit_6 = false;
|
||||||
bool smBit_7 = false;
|
bool smBit_7 = false;
|
||||||
bool smBit_8 = false;
|
bool smBit_8 = false;
|
||||||
bool debugFileOK = false;
|
|
||||||
bool privateMsgFlag = false;
|
bool privateMsgFlag = false;
|
||||||
|
|
||||||
char inputStr[256] = {0};
|
char inputStr[256] = {0};
|
||||||
@ -2846,9 +2845,7 @@ void nesca_3::ConnectEvrthng()
|
|||||||
connect ( ui->startScanButton_3, SIGNAL( clicked() ), this, SLOT( startScanButtonClicked() ) );
|
connect ( ui->startScanButton_3, SIGNAL( clicked() ), this, SLOT( startScanButtonClicked() ) );
|
||||||
connect ( ui->startScanButton_4, SIGNAL( clicked() ), this, SLOT( startScanButtonClickedDNS() ) );
|
connect ( ui->startScanButton_4, SIGNAL( clicked() ), this, SLOT( startScanButtonClickedDNS() ) );
|
||||||
connect ( ui->shuffle_onoff, SIGNAL(toggled(bool)), this, SLOT(ChangeShuffle(bool)));
|
connect ( ui->shuffle_onoff, SIGNAL(toggled(bool)), this, SLOT(ChangeShuffle(bool)));
|
||||||
connect ( ui->trackerOnOff, SIGNAL(toggled(bool)), this, SLOT(ChangeTrackerOK(bool)));
|
connect ( ui->trackerOnOff, SIGNAL(toggled(bool)), this, SLOT(ChangeTrackerOK(bool)));
|
||||||
// connect ( ui->pingingOnOff, SIGNAL( toggled(bool) ), this, SLOT( ChangePingerOK(bool) ) );
|
|
||||||
connect ( ui->debugFileOnOff, SIGNAL( toggled(bool) ), this, SLOT( ChangeDebugFileState(bool) ) );
|
|
||||||
connect ( ui->importThreads, SIGNAL( textChanged(QString) ), this, SLOT( ChangeLabelThreads_ValueChanged(QString) ) );
|
connect ( ui->importThreads, SIGNAL( textChanged(QString) ), this, SLOT( ChangeLabelThreads_ValueChanged(QString) ) );
|
||||||
connect ( ui->threadLine, SIGNAL( textChanged(QString) ), this, SLOT( ChangeLabelThreads_ValueChanged(QString) ) );
|
connect ( ui->threadLine, SIGNAL( textChanged(QString) ), this, SLOT( ChangeLabelThreads_ValueChanged(QString) ) );
|
||||||
connect ( ui->PingTO, SIGNAL( textChanged(QString) ), this, SLOT( PingTO_ChangeValue(QString) ) );
|
connect ( ui->PingTO, SIGNAL( textChanged(QString) ), this, SLOT( PingTO_ChangeValue(QString) ) );
|
||||||
@ -2969,7 +2966,7 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
strncpy(gPorts, ("-p" + ui->portLine->text()).toLocal8Bit().data(), 65536);
|
strncpy(gPorts, ("-p" + ui->portLine->text()).toLocal8Bit().data(), 65536);
|
||||||
gPorts[ui->lineEditPort->text().size()] = '\0';
|
gPorts[ui->lineEditPort->text().length() + 2] = '\0';
|
||||||
}
|
}
|
||||||
else if(savedTabIndex == 1)
|
else if(savedTabIndex == 1)
|
||||||
{
|
{
|
||||||
@ -2979,7 +2976,7 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) {
|
|||||||
strcpy(currentIP, ui->lineEditStartIPDNS->text().toLocal8Bit().data());
|
strcpy(currentIP, ui->lineEditStartIPDNS->text().toLocal8Bit().data());
|
||||||
strcpy(top_level_domain, ui->lineILVL->text().toLocal8Bit().data());
|
strcpy(top_level_domain, ui->lineILVL->text().toLocal8Bit().data());
|
||||||
strncpy(gPorts, ("-p" + ui->lineEditPort->text()).toLocal8Bit().data(), 65536);
|
strncpy(gPorts, ("-p" + ui->lineEditPort->text()).toLocal8Bit().data(), 65536);
|
||||||
gPorts[ui->lineEditPort->text().size()] = '\0';
|
gPorts[ui->lineEditPort->text().length() + 2] = '\0';
|
||||||
};
|
};
|
||||||
|
|
||||||
strcpy(trcSrv, ui->lineTrackerSrv->text().toLocal8Bit().data());
|
strcpy(trcSrv, ui->lineTrackerSrv->text().toLocal8Bit().data());
|
||||||
@ -3398,19 +3395,9 @@ void nesca_3::ChangePingerOK(bool val)
|
|||||||
{
|
{
|
||||||
ui->PingTO->setEnabled(val);
|
ui->PingTO->setEnabled(val);
|
||||||
gPingNScan = val;
|
gPingNScan = val;
|
||||||
if(val == false)
|
|
||||||
{
|
|
||||||
ui->PingTO->setStyleSheet("color: rgb(116, 116, 116);background-color: rgb(56, 56, 56);border:none;");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->PingTO->setStyleSheet("color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:none;");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void nesca_3::ChangeDebugFileState(bool val)
|
if(val == false) ui->PingTO->setStyleSheet("color: rgb(116, 116, 116);background-color: rgb(56, 56, 56);border:none;");
|
||||||
{
|
else ui->PingTO->setStyleSheet("color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:none;");
|
||||||
debugFileOK = val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nesca_3::STTTerminate()
|
void nesca_3::STTTerminate()
|
||||||
@ -3439,38 +3426,6 @@ void nesca_3::STTTerminate()
|
|||||||
stt->terminate();
|
stt->terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dfLocked = false;
|
|
||||||
void writeDebugFile(QString str)
|
|
||||||
{
|
|
||||||
while(dfLocked) Sleep(10);
|
|
||||||
QDate qd;
|
|
||||||
char b[8] = {0};
|
|
||||||
char fn[64] = {0};
|
|
||||||
strcpy(fn, "./output_");
|
|
||||||
sprintf(b, "%d", qd.currentDate().day());
|
|
||||||
strcat(fn, b);
|
|
||||||
strcat(fn, "_");
|
|
||||||
sprintf(b, "%d", qd.currentDate().month());
|
|
||||||
strcat(fn, b);
|
|
||||||
strcat(fn, "_");
|
|
||||||
sprintf(b, "%d", qd.currentDate().year());
|
|
||||||
strcat(fn, b);
|
|
||||||
strcat(fn, ".txt");
|
|
||||||
|
|
||||||
FILE *df = fopen(fn, "a");
|
|
||||||
if(df != NULL)
|
|
||||||
{
|
|
||||||
dfLocked = true;
|
|
||||||
fputs(str.toLocal8Bit().data(), df);
|
|
||||||
fclose(df);
|
|
||||||
dfLocked = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
stt->doEmitionRedFoundData("[DEBUG: Cannot open " + QString(fn) + "]");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void nesca_3::startScanButtonClicked()
|
void nesca_3::startScanButtonClicked()
|
||||||
{
|
{
|
||||||
if(startFlag == false)
|
if(startFlag == false)
|
||||||
@ -3624,8 +3579,7 @@ void nesca_3::appendGreenBAData(QString str)
|
|||||||
|
|
||||||
void nesca_3::appendDefaultText(QString str)
|
void nesca_3::appendDefaultText(QString str)
|
||||||
{
|
{
|
||||||
ui->dataText->append("<p style=\"color: #a1a1a1;\">[" + QTime::currentTime().toString() + "] " + str + "</p>");
|
ui->dataText->append("<p style=\"color: #a1a1a1;\">[" + QTime::currentTime().toString() + "] " + str + "</p>");
|
||||||
if(debugFileOK) writeDebugFile(str + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nesca_3::appendErrText(QString str)
|
void nesca_3::appendErrText(QString str)
|
||||||
@ -3639,26 +3593,22 @@ void nesca_3::appendErrText(QString str)
|
|||||||
stt->doEmitionIPS("0");
|
stt->doEmitionIPS("0");
|
||||||
ui->startScanButton_3->setText("Start");
|
ui->startScanButton_3->setText("Start");
|
||||||
stt->terminate();
|
stt->terminate();
|
||||||
};
|
};
|
||||||
if(debugFileOK) writeDebugFile(str + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nesca_3::appendOKText(QString str)
|
void nesca_3::appendOKText(QString str)
|
||||||
{
|
{
|
||||||
ui->dataText->append("<span style=\"color:#06ff00;\">[" + QTime::currentTime().toString() + "][OK] " + str + "</span>");
|
ui->dataText->append("<span style=\"color:#06ff00;\">[" + QTime::currentTime().toString() + "][OK] " + str + "</span>");
|
||||||
if(debugFileOK) writeDebugFile(str + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nesca_3::appendNotifyText(QString str)
|
void nesca_3::appendNotifyText(QString str)
|
||||||
{
|
{
|
||||||
ui->dataText->append("<span style=\"color:#efe100;\">[" + QTime::currentTime().toString() + "][*] " + str + "</span>");
|
ui->dataText->append("<span style=\"color:#efe100;\">[" + QTime::currentTime().toString() + "][*] " + str + "</span>");
|
||||||
if(debugFileOK) writeDebugFile(str + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nesca_3::appendDebugText(QString str)
|
void nesca_3::appendDebugText(QString str)
|
||||||
{
|
{
|
||||||
ui->dataText->append("<span style=\"color:#0084ff;\">[DEBUG] " + str + "</span>");
|
ui->dataText->append("<span style=\"color:#0084ff;\">[DEBUG] " + str + "</span>");
|
||||||
if(debugFileOK) writeDebugFile(str + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "mainResources.h"
|
#include "mainResources.h"
|
||||||
|
|
||||||
extern Ui::nesca_3Class *ui;
|
extern Ui::nesca_3Class *ui;
|
||||||
extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK, QOSWait,
|
extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, QOSWait,
|
||||||
connectedToIRC, ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag,
|
connectedToIRC, ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag,
|
||||||
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
|
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
|
||||||
extern float QoSStep;
|
extern float QoSStep;
|
||||||
@ -69,8 +69,7 @@ protected:
|
|||||||
void DNSLine_ValueChanged();
|
void DNSLine_ValueChanged();
|
||||||
void slotChangeCPModeToUTF();
|
void slotChangeCPModeToUTF();
|
||||||
void slotChangeCPModeTo1251();
|
void slotChangeCPModeTo1251();
|
||||||
void slotShowRedVersion();
|
void slotShowRedVersion();
|
||||||
void ChangeDebugFileState(bool val);
|
|
||||||
void ChangeTopic();
|
void ChangeTopic();
|
||||||
void slotIRCGetTopic(QString str);
|
void slotIRCGetTopic(QString str);
|
||||||
void slotIRCOfflined();
|
void slotIRCOfflined();
|
||||||
|
46
nesca_3.ui
46
nesca_3.ui
@ -176,7 +176,7 @@
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Eurostile</family>
|
<family>Eurostile</family>
|
||||||
<pointsize>9</pointsize>
|
<pointsize>8</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
@ -486,7 +486,7 @@
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Eurostile</family>
|
<family>Eurostile</family>
|
||||||
<pointsize>9</pointsize>
|
<pointsize>8</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
@ -793,7 +793,7 @@ color: rgb(214, 214, 0);</string>
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Eurostile</family>
|
<family>Eurostile</family>
|
||||||
<pointsize>9</pointsize>
|
<pointsize>8</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
@ -973,8 +973,8 @@ border-radius: 3px;</string>
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>30</x>
|
<x>30</x>
|
||||||
<y>100</y>
|
<y>120</y>
|
||||||
<width>241</width>
|
<width>281</width>
|
||||||
<height>17</height>
|
<height>17</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -990,7 +990,7 @@ border-radius: 3px;</string>
|
|||||||
<string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string>
|
<string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Send results to NescaDatabase</string>
|
<string>Send results to public NescaDatabase</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -1142,34 +1142,6 @@ border-radius: 3px;</string>
|
|||||||
<string>Check key</string>
|
<string>Check key</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QCheckBox" name="debugFileOnOff">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>116</y>
|
|
||||||
<width>276</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Eurostile</family>
|
|
||||||
<pointsize>8</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>[DEBUG] Write main output to file "./logs/output.txt"</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="pingingOnOff">
|
<widget class="QCheckBox" name="pingingOnOff">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@ -2546,7 +2518,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="cursorWidth">
|
<property name="cursorWidth">
|
||||||
@ -3530,7 +3502,7 @@ background-color: #000000;</string>
|
|||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="acceptRichText">
|
<property name="acceptRichText">
|
||||||
@ -3666,7 +3638,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:2px; margin-bottom:2px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:2px; margin-bottom:2px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="acceptRichText">
|
<property name="acceptRichText">
|
||||||
|
Loading…
Reference in New Issue
Block a user