progress output fix

This commit is contained in:
cora48 2015-03-23 11:39:37 +03:00
parent 11fbb5cb8a
commit 1541b22ce1
5 changed files with 24 additions and 27 deletions

View File

@ -179,7 +179,7 @@ int _EstablishSSHConnection(const char* host, int port, std::string *buffer, con
for(int i = 0; i < MaxSSHPass; ++i)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
strcpy(temp, sshlpLst[i]);
ptr1 = strstr(temp, ":");
sz = ptr1 - temp;

View File

@ -62,10 +62,10 @@ lopaStr WFClass::doGetCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;
@ -105,10 +105,10 @@ lopaStr WFClass::doPostCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;

View File

@ -498,13 +498,13 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
for(int i = 0; i < MaxLogin; i++)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
if(strcmp(loginLst[i], " ") == 0) continue;
ZeroMemory(login, sizeof(login));
strcpy(login, loginLst[i]);
for(int j = 0; j < MaxPass; j++)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
if(strcmp(passLst[j], " ") == 0) continue;
ZeroMemory(pass, sizeof(pass));

View File

@ -2724,7 +2724,7 @@ void nesca_3::slotShowServerMsg(QString str)
void nesca_3::DNSLine_ValueChanged()
{
if(globalScanFlag == 0) ui->startScanButton_4->setText("Start");
if(!globalScanFlag) ui->startScanButton_4->setText("Start");
}
void nesca_3::slotRestoreDefPorts()

View File

@ -408,7 +408,7 @@ void _tracker() {
while(true) {
while(!trackerOK) Sleep(1000);
if(globalScanFlag == false && jsonArr->size() == 0) break;
if(!globalScanFlag && jsonArr->size() == 0) break;
char rBuffT[250000] = {0};
char *msg = new char[4096];
ZeroMemory(msg, sizeof(*msg));
@ -563,7 +563,7 @@ void _tracker() {
while(true)
{
if(globalScanFlag == false && jsonArr->size() == 0) break;
if(!globalScanFlag && jsonArr->size() == 0) break;
if(!trackerOK) {
Sleep(1000);
continue;
@ -797,7 +797,7 @@ void _connect() {
ConInc();
for (int i = 0; i <= overallPorts; ++i)
{
if (globalScanFlag == false) break;
if (!globalScanFlag) break;
if (Connector::_ConnectToPort(ip, portArr[i], "") == -2) break;
};
ConDec();
@ -813,8 +813,8 @@ void verboseProgress(long long unsigned int target, const char *ip) {
stt->doEmitionIPRANGE(QString(ip));
strcpy(currentIP, ip);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
@ -828,8 +828,8 @@ void verboseProgressDNS(long long unsigned int target, const char *ip, const cha
stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, ip);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
@ -2069,17 +2069,14 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
int szMask = strlen(mask);
int szOffset = startPosition + 2;
if(szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1);
else
{
ZeroMemory(maskEnd, sizeof(maskEnd));
};
else ZeroMemory(maskEnd, sizeof(maskEnd));;
char maskSaver[128] = {0};
if(firstPos != -1 && secondPos != -1)
{
for(int i = firstPos; i <= secondPos; ++i)
{
if(globalScanFlag == false) break;
if(!globalScanFlag) break;
strcpy(maskSaver, saveMask);
strcat(maskSaver, maskEntry);
@ -2101,7 +2098,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
strcpy(endIP2, saveMask);
while(cons >= gThreads && globalScanFlag) Sleep(300);
if(globalScanFlag == false) return 0;
if(!globalScanFlag) return 0;
string res = string(mask);
verboseProgressDNS(--gTargets, res.c_str(), top_level_domain);
@ -2193,7 +2190,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break;
if (!globalScanFlag) break;
unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i);
@ -2206,7 +2203,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IPM;
if (!globalScanFlag) goto haters_gonna_hate_IPM;
++indexIP;
std::string res = ipVec[0];
@ -2227,7 +2224,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break;
if (!globalScanFlag) break;
std::string res = "";
++indexIP;
@ -2400,7 +2397,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break;
if (!globalScanFlag) break;
unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i);
@ -2413,7 +2410,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IM;
if (!globalScanFlag) goto haters_gonna_hate_IM;
++indexIP;
std::string res = ipVec[0];
@ -2433,7 +2430,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break;
if (!globalScanFlag) break;
++indexIP;