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
2d0b97bbba
commit
b184de7c44
58
nesca_3.cpp
58
nesca_3.cpp
@ -47,7 +47,6 @@ bool smBit_5 = false;
|
||||
bool smBit_6 = false;
|
||||
bool smBit_7 = false;
|
||||
bool smBit_8 = false;
|
||||
bool debugFileOK = false;
|
||||
bool privateMsgFlag = false;
|
||||
|
||||
char inputStr[256] = {0};
|
||||
@ -2847,8 +2846,6 @@ void nesca_3::ConnectEvrthng()
|
||||
connect ( ui->startScanButton_4, SIGNAL( clicked() ), this, SLOT( startScanButtonClickedDNS() ) );
|
||||
connect ( ui->shuffle_onoff, SIGNAL(toggled(bool)), this, SLOT(ChangeShuffle(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->threadLine, SIGNAL( textChanged(QString) ), this, SLOT( ChangeLabelThreads_ValueChanged(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);
|
||||
gPorts[ui->lineEditPort->text().size()] = '\0';
|
||||
gPorts[ui->lineEditPort->text().length() + 2] = '\0';
|
||||
}
|
||||
else if(savedTabIndex == 1)
|
||||
{
|
||||
@ -2979,7 +2976,7 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) {
|
||||
strcpy(currentIP, ui->lineEditStartIPDNS->text().toLocal8Bit().data());
|
||||
strcpy(top_level_domain, ui->lineILVL->text().toLocal8Bit().data());
|
||||
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());
|
||||
@ -3398,19 +3395,9 @@ void nesca_3::ChangePingerOK(bool val)
|
||||
{
|
||||
ui->PingTO->setEnabled(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)
|
||||
{
|
||||
debugFileOK = 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::STTTerminate()
|
||||
@ -3439,38 +3426,6 @@ void nesca_3::STTTerminate()
|
||||
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()
|
||||
{
|
||||
if(startFlag == false)
|
||||
@ -3625,7 +3580,6 @@ void nesca_3::appendGreenBAData(QString str)
|
||||
void nesca_3::appendDefaultText(QString str)
|
||||
{
|
||||
ui->dataText->append("<p style=\"color: #a1a1a1;\">[" + QTime::currentTime().toString() + "] " + str + "</p>");
|
||||
if(debugFileOK) writeDebugFile(str + "\n");
|
||||
}
|
||||
|
||||
void nesca_3::appendErrText(QString str)
|
||||
@ -3640,25 +3594,21 @@ void nesca_3::appendErrText(QString str)
|
||||
ui->startScanButton_3->setText("Start");
|
||||
stt->terminate();
|
||||
};
|
||||
if(debugFileOK) writeDebugFile(str + "\n");
|
||||
}
|
||||
|
||||
void nesca_3::appendOKText(QString str)
|
||||
{
|
||||
ui->dataText->append("<span style=\"color:#06ff00;\">[" + QTime::currentTime().toString() + "][OK] " + str + "</span>");
|
||||
if(debugFileOK) writeDebugFile(str + "\n");
|
||||
}
|
||||
|
||||
void nesca_3::appendNotifyText(QString str)
|
||||
{
|
||||
ui->dataText->append("<span style=\"color:#efe100;\">[" + QTime::currentTime().toString() + "][*] " + str + "</span>");
|
||||
if(debugFileOK) writeDebugFile(str + "\n");
|
||||
}
|
||||
|
||||
void nesca_3::appendDebugText(QString str)
|
||||
{
|
||||
ui->dataText->append("<span style=\"color:#0084ff;\">[DEBUG] " + str + "</span>");
|
||||
if(debugFileOK) writeDebugFile(str + "\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "mainResources.h"
|
||||
|
||||
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,
|
||||
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
|
||||
extern float QoSStep;
|
||||
@ -70,7 +70,6 @@ protected:
|
||||
void slotChangeCPModeToUTF();
|
||||
void slotChangeCPModeTo1251();
|
||||
void slotShowRedVersion();
|
||||
void ChangeDebugFileState(bool val);
|
||||
void ChangeTopic();
|
||||
void slotIRCGetTopic(QString str);
|
||||
void slotIRCOfflined();
|
||||
|
46
nesca_3.ui
46
nesca_3.ui
@ -176,7 +176,7 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Eurostile</family>
|
||||
<pointsize>9</pointsize>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -486,7 +486,7 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Eurostile</family>
|
||||
<pointsize>9</pointsize>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -793,7 +793,7 @@ color: rgb(214, 214, 0);</string>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Eurostile</family>
|
||||
<pointsize>9</pointsize>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -973,8 +973,8 @@ border-radius: 3px;</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>100</y>
|
||||
<width>241</width>
|
||||
<y>120</y>
|
||||
<width>281</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</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>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send results to NescaDatabase</string>
|
||||
<string>Send results to public NescaDatabase</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -1142,34 +1142,6 @@ border-radius: 3px;</string>
|
||||
<string>Check key</string>
|
||||
</property>
|
||||
</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">
|
||||
<property name="geometry">
|
||||
<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">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
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>
|
||||
</property>
|
||||
<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">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
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>
|
||||
</property>
|
||||
<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">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
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>
|
||||
</property>
|
||||
<property name="acceptRichText">
|
||||
|
Loading…
Reference in New Issue
Block a user