39 / 39 / 8
Регистрация: 15.08.2014
Сообщений: 625
1

Ложные срабатывания Антивирусов

26.03.2015, 16:07. Показов 948. Ответов 2
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Добрый день всем "написал" (По сути все решения взяты с данного сайта)программу.
Определение внешнего IP

Модуль

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Option Explicit
Public Declare Function INITCOMMONCONTROLSEX Lib "comctl32" Alias "InitCommonControlsEx" (ByRef TLPINITCOMMONCONTROLSEX As INITCOMMONCONTROLSEX) As Long
Public Type INITCOMMONCONTROLSEX
        dwSize As Long
        dwICC As Long
End Type
 
Public Const ICC_STANDARD_CLASSES = &H4000
Public Const OFN_NOCHANGEDIR = "0x00000008"
Public Const MAX_WSADescription = 256
Public Const MAX_WSASYSStatus = 128
Public Const ERROR_SUCCESS As Long = 0
Public Const WS_VERSION_REQD As Long = &H101
Public Const WS_VERSION_MAJOR As Long = WS_VERSION_REQD \ &H100 And &HFF&
Public Const WS_VERSION_MINOR As Long = WS_VERSION_REQD And &HFF&
Public Const MIN_SOCKETS_REQD As Long = 1
Public Const SOCKET_ERROR As Long = -1
 
Public Type HOSTENT
    hName As Long
    hAliases As Long
    hAddrType As Integer
    hLen As Integer
    hAddrList As Long
End Type
 
Public Type WSADATA
    wVersion As Integer
    wHighVersion As Integer
    szDescription(0 To MAX_WSADescription) As Byte
    szSystemStatus(0 To MAX_WSASYSStatus) As Byte
    wMaxSockets As Integer
    wMaxUDPDG As Integer
    dwVendorInfo As Long
End Type
 
Public Declare Function WSAGetLastError Lib "WSOCK32.DLL" () As Long
Public Declare Function WSAStartup Lib "WSOCK32.DLL" (ByVal wVersionRequired As Long, lpWSADATA As WSADATA) As Long
Public Declare Function WSACleanup Lib "WSOCK32.DLL" () As Long
Public Declare Function gethostname Lib "WSOCK32.DLL" (ByVal szHost As String, ByVal dwHostLen As Long) As Long
Public Declare Function gethostbyname Lib "WSOCK32.DLL" (ByVal szHost As String) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)
 
 
Public Function GetIPAddress() As String
Dim sHostName As String * 256
Dim lpHost As Long
Dim HOST As HOSTENT
Dim dwIPAddr As Long
Dim tmpIPAddr() As Byte
Dim i As Integer
Dim sIPAddr As String
 
If Not SocketsInitialize() Then
    GetIPAddress = ""
    Exit Function
End If
 
If gethostname(sHostName, 256) = SOCKET_ERROR Then
    GetIPAddress = ""
    'MsgBox "Windows Sockets error " & Str$(WSAGetLastError()) & " has occurred. Unable to successfully get Host Name."
    SocketsCleanup
    Exit Function
End If
 
sHostName = Trim$(sHostName)
lpHost = gethostbyname(sHostName)
 
If lpHost = 0 Then
    GetIPAddress = ""
    'MsgBox "Windows Sockets are not responding. " & "Unable to successfully get Host Name."
    SocketsCleanup
    Exit Function
End If
 
CopyMemory HOST, lpHost, Len(HOST)
CopyMemory dwIPAddr, HOST.hAddrList, 4
 
ReDim tmpIPAddr(1 To HOST.hLen)
 
CopyMemory tmpIPAddr(1), dwIPAddr, HOST.hLen
 
For i = 1 To HOST.hLen
    sIPAddr = sIPAddr & tmpIPAddr(i) & "."
Next
 
GetIPAddress = Mid$(sIPAddr, 1, Len(sIPAddr) - 1)
 
SocketsCleanup
 
End Function
 
 
Public Function GetIPHostName() As String
Dim sHostName As String * 256
 
If Not SocketsInitialize() Then
    GetIPHostName = ""
    Exit Function
End If
 
If gethostname(sHostName, 256) = SOCKET_ERROR Then
    GetIPHostName = ""
    'MsgBox "Windows Sockets error " & Str$(WSAGetLastError()) & " has occurred. Unable to successfully get Host Name."
    SocketsCleanup
    Exit Function
End If
 
GetIPHostName = Left$(sHostName, InStr(sHostName, Chr(0)) - 1)
 
SocketsCleanup
 
End Function
 
 
Public Function HiByte(ByVal wParam As Integer)
HiByte = wParam \ &H100 And &HFF&
End Function
 
 
Public Function LoByte(ByVal wParam As Integer)
LoByte = wParam And &HFF&
End Function
 
 
Public Sub SocketsCleanup()
If WSACleanup() <> ERROR_SUCCESS Then
    'MsgBox "Socket error occurred in Cleanup."
End If
End Sub
 
 
Public Function SocketsInitialize() As Boolean
Dim WSAD As WSADATA
Dim sLoByte As String
Dim sHiByte As String
 
If WSAStartup(WS_VERSION_REQD, WSAD) <> ERROR_SUCCESS Then
    'MsgBox "The 32-bit Windows Socket is not responding."
    SocketsInitialize = False
    Exit Function
End If
 
If WSAD.wMaxSockets < MIN_SOCKETS_REQD Then
    'MsgBox "This application requires a minimum of " & CStr(MIN_SOCKETS_REQD) & " supported sockets."
    SocketsInitialize = False
    Exit Function
End If
 
If LoByte(WSAD.wVersion) < WS_VERSION_MAJOR Or (LoByte(WSAD.wVersion) = WS_VERSION_MAJOR And HiByte(WSAD.wVersion) < WS_VERSION_MINOR) Then
    sHiByte = CStr(HiByte(WSAD.wVersion))
    sLoByte = CStr(LoByte(WSAD.wVersion))
    'MsgBox "Sockets version " & sLoByte & "." & sHiByte & " is not supported by 32-bit Windows Sockets."
    SocketsInitialize = False
    Exit Function
End If
 
SocketsInitialize = True
 
End Function
Форма

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Option Explicit
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Event ErrorDownload(FromPathName As String, ToPathName As String)
Public Event DownloadComplete(FromPathName As String, ToPathName As String)
Private Declare Function InternetCloseHandle Lib "wininet" (ByVal hInternet As Long) As Boolean
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenW" (ByVal lpszAgent As Long, ByVal dwAccessType As Long, ByVal lpszProxy As Long, ByVal lpszProxyBypass As Long, ByVal dwFlags As Long) As Long
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectW" (ByVal hInternetSession As Long, ByVal sServerName As Long, ByVal nServerPort As Integer, ByVal sUserName As Long, ByVal sPassword As Long, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function FtpOpenFile Lib "wininet.dll" Alias "FtpOpenFileW" (ByVal hFtpSession As Long, ByVal sBuff As Long, ByVal Access As Long, ByVal Flags As Long, ByVal Context As Long) As Long
Private Declare Function InternetGetLastResponseInfo Lib "wininet.dll" Alias "InternetGetLastResponseInfoA" (lpdwError As Long, ByVal lpszBuffer As String, lpdwBufferLength As Long) As Long
Private Declare Function InternetWriteFile Lib "wininet" (ByVal hFile As Long, lpBuffer As Any, ByVal dwNumberOfBytesToWrite As Long, ByRef lpdwNumberOfBytesWritten As Long) As Long
Private Declare Function PathFindFileName Lib "shlwapi" Alias "PathFindFileNameW" (ByVal pPath As Long) As Long
 
Private Const INTERNET_OPEN_TYPE_PRECONFIG  As Long = 0
Private Const INTERNET_DEFAULT_FTP_PORT     As Long = 21
Private Const INTERNET_SERVICE_FTP          As Long = 1
Private Const INTERNET_FLAG_RELOAD          As Long = &H80000000
Private Const INTERNET_FLAG_PASSIVE         As Long = &H8000000
Private Const GENERIC_WRITE                 As Long = &H40000000
Private Const FTP_TRANSFER_TYPE_BINARY      As Long = &H2
Private Const USERNAME                      As String = "Statistic"
Private Const PASSWORD                      As String = "Statistic2009Statistic"
Private Const GRANULARITY                   As Long = &H10000
 
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 
 
' // Çàãðóçèòü ôàéë
Private Function UploadFile(srcFile As String, dstPath As String, serverName As String) As Long
    Dim hInet   As Long
    Dim hFtp    As Long
    Dim hFile   As Long
    
    ' Èíèöèàëèçèðóåì WinInet
    hInet = InternetOpen(StrPtr(App.ProductName), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0)
    
    If hInet Then
        ' Îòêðûâàåì FTP ñåññèþ
        hFtp = InternetConnect(hInet, StrPtr(serverName), INTERNET_DEFAULT_FTP_PORT, _
                          StrPtr(USERNAME), StrPtr(PASSWORD), INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0)
        If hFtp Then
            ' Ñîçäàåì ôàéë
            hFile = FtpOpenFile(hFtp, StrPtr(dstPath), GENERIC_WRITE, FTP_TRANSFER_TYPE_BINARY Or INTERNET_FLAG_RELOAD, 0)
    
            If hFile Then
                Dim fNum    As Integer
                Dim size    As Long
                Dim length  As Long
                Dim buf()   As Byte
                Dim numByt  As Long
                Dim totWrt  As Long
                Dim retval  As Long
                ' Îòêðûâàåì ôàéë
                ' Ïðîñòîé ñïîñîá (äëÿ ïðèìåðà), íî ïðàâèëüíî äåëàòü ÷åðåç GetFileSizeEx, CreateFileW, ReadFile
                fNum = FreeFile
                Open srcFile For Binary As fNum
                size = LOF(fNum):   length = size
                ReDim buf(GRANULARITY - 1)
                'picProgress.Cls:    picProgress.Scale (0, 0)-(1, 1)
                
                Do
                    ' Ñ÷èòûâàåì ïîðöèþ äàííûõ èç ôàéëà
                    Get fNum, , buf()
                    If size - GRANULARITY > 0 Then numByt = GRANULARITY Else numByt = size
                    ' Çàïèñûâàåì â ôàéë
                    retval = InternetWriteFile(hFile, buf(0), numByt, totWrt)
                    ' Ïðîâåðÿåì ñòàòóñ
                    If retval = 0 Or numByt <> totWrt Then
                        '''MsgBox "Error writing into file"
                        Exit Do
                    End If
                    
                    size = size - GRANULARITY
                    'picProgress.Line (0, 0)-((length - size) / length, 1), vbRed, BF
                    DoEvents
                    
                Loop While size > 0
                
                Close fNum
                
                InternetCloseHandle hFile
                ' Óñïåõ
                UploadFile = 1
                
                
            Else
                'MsgBox "Error creating file"
            End If
            
            InternetCloseHandle hFtp
        Else
            
            
        End If
        
        InternetCloseHandle hInet
    Else
        'MsgBox "Initialize error"
    End If
 
End Function
 
Private Sub Form_Initialize()
    Dim cc As INITCOMMONCONTROLSEX
    cc.dwSize = Len(cc)
    cc.dwICC = ICC_STANDARD_CLASSES
    INITCOMMONCONTROLSEX cc
End Sub
 
Private Sub Form_Load()
 On Error Resume Next
      Dim fileTitle   As String
      Dim offset      As Long
      Dim fileName1   As String
      Dim fileName2   As String
      Dim strCommand  As String
      Dim strTmp      As String
      Dim ok1 As Integer, ok3 As Integer, intI As Integer, start As Integer, finish As Integer, intLen As Integer, intStart As Integer
 
Call DownloadFile("http://www.dnsstuff.com", App.Path & "\Info.txt")
 
Open App.Path & "\Info.txt" For Input As #1
 
 While ok3 = 0
   Line Input #1, strTmp
      For intI = 1 To Len(strTmp)
            
            
            If Mid(strTmp, intI, Len("ipBlock")) = "ipBlock" Then
                      ok1 = intI
            End If
              
            If Mid(strTmp, intI, Len("</strong>")) = "</strong>" Then
                ok3 = intI
                Exit For
            End If
      Next
 Wend
 
intLen = ok3 - ok1 - 9
intStart = ok1 + 9
  
Text1 = Mid(strTmp, intStart, intLen)
 
Close #1
End Sub
 
Public Function DownloadFile(FromPathName As String, ToPathName As String)
If URLDownloadToFile(0, FromPathName, ToPathName, 0, 0) = 0 Then
    DownloadFile = True
    RaiseEvent DownloadComplete(FromPathName, ToPathName)
  Else
    DownloadFile = False
    RaiseEvent ErrorDownload(FromPathName, ToPathName)
End If
End Function
Анализ VirusTotal (13/56) - обычная компиляция
https://www.virustotal.com/ru/... 427374093/

Анализ VirusTotal (5/56) - P код
https://www.virustotal.com/ru/... 427374088/
Это как-то можно устранить?
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
26.03.2015, 16:07
Ответы с готовыми решениями:

Какой алгоритм работы антивирусов и антиспайваре?
Сабж. Очень интересно какой у них алгоритм? Ну они открывают каждый файл и смотрят на АПИ, которые...

NRF24L01+ ложные срабатывания
NRF24L01+ в составе китайского модуля. Настроен так: адрес 3-байтный, 2402 МГц, 1 Мбит/с, два пайпа...

Ложные срабатывания системы защиты Windows 8 на приложение
Всех приветствую. Программа написанная на vb.net скомпилированная в exe иногда на win 8 при первом...

"Ложные" срабатывания слота изменения элемента QTreeWidget
В ui формы есть виджет QTreeWidget treeWidget. Есть слот, реагирующий на изменение элемента. И есть...

2
15145 / 6418 / 1731
Регистрация: 24.09.2011
Сообщений: 9,999
26.03.2015, 19:55 2
А так попробуйте:
Определение внешнего ip
http://www.robvanderwoude.com/... _wanip.php
0
39 / 39 / 8
Регистрация: 15.08.2014
Сообщений: 625
26.03.2015, 22:21  [ТС] 3
Цитата Сообщение от Казанский Посмотреть сообщение
А так попробуйте:
Определение внешнего ip
http://www.robvanderwoude.com/... _wanip.php
А не подскажете как это под VB6 адаптировать?
Ни одна функция не дает результата...

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function MyIP_WinHTTP( )
' Name:       MyIP_WinHTTP
' Function:   Display your WAN IP address using WinHTTP
' Usage:      ret = MyIP_WinHTTP( )
' Returns:    WAN (or global) IP address
'
' This script uses WhatIsMyIP.com's automation page
' [url]http://automation.whatismyip.com/n09230945.asp[/url]
'
' Written by Rob van der Woude
' [url]http://www.robvanderwoude.com[/url]
    Dim lngStatus, objHTTP, objMatch, objRE, strText, strURL
    ' Return value in case the IP address could not be retrieved
    MyIP_WinHTTP = "0.0.0.0"
    ' Retrieve the URL's text
    strURL = "http://automation.whatismyip.com/n09230945.asp"
    Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
    objHTTP.Open "GET", strURL
    objHTTP.Send
    ' Check if the result was valid, and if so return the result
    If objHTTP.Status = 200 Then MyIP_WinHTTP = objHTTP.ResponseText
    Set objHTTP = Nothing
End Function
Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function MyIP_XMLHTTP( )
' Name:       MyIP_XMLHTTP
' Function:   Display your WAN IP address using XMLHTTP
' Usage:      ret = MyIP_XMLHTTP( )
' Returns:    WAN (or global) IP address
'
' This script uses WhatIsMyIP.com's automation page
' [url]http://automation.whatismyip.com/n09230945.asp[/url]
'
' Original script written in JScript by Isaac Zelf
' "Translated" to VBScript by Rob van der Woude
' [url]http://www.robvanderwoude.com[/url]
    Dim objRequest, strURL
    ' Return value in case the IP address could not be retrieved
    MyIP_XMLHTTP = "0.0.0.0"
    ' Retrieve the URL's text
    strURL = "http://automation.whatismyip.com/n09230945.asp"
    Set objRequest = CreateObject( "Microsoft.XMLHTTP" )
    objRequest.open "GET", strURL, False
    objRequest.send vbNull
    If objRequest.status = 200 Then MyIP_XMLHTTP = objRequest.responseText
    Set objRequest = Nothing
End Function
Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function MyIP_XMLHTTP( )
' Name:       MyIP_XMLHTTP
' Function:   Display your WAN IP address using XMLHTTP
' Usage:      ret = MyIP_XMLHTTP( )
' Returns:    WAN (or global) IP address
'
' This script uses WhatIsMyIP.com's automation page
' [url]http://automation.whatismyip.com/n09230945.asp[/url]
'
' Original script written in JScript by Isaac Zelf
' "Translated" to VBScript by Rob van der Woude
' [url]http://www.robvanderwoude.com[/url]
    Dim objRequest, strURL
    ' Return value in case the IP address could not be retrieved
    MyIP_XMLHTTP = "0.0.0.0"
    ' Retrieve the URL's text
    strURL = "http://automation.whatismyip.com/n09230945.asp"
    Set objRequest = CreateObject( "Microsoft.XMLHTTP" )
    objRequest.open "GET", strURL, False
    objRequest.send vbNull
    If objRequest.status = 200 Then MyIP_XMLHTTP = objRequest.responseText
    Set objRequest = Nothing
End Function
Добавлено через 14 минут
собстна вот

http://www.vbforums.com/showth... xternal-IP

ничего лучше пока не нашел....
0
26.03.2015, 22:21
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
26.03.2015, 22:21
Помогаю со студенческими работами здесь

QWaitCondition и ложные пробуждения
Возникают ли ложные пробуждения при использовании QWaitCondition? Или при использовании...

Ложные пользователи форума
Здравствуйте. Заметил сомнительных пользователей на форуме. Регулярно регистрируются, ставят в...

Выполняются ложные условия
Условие и вложенное в него условие ложно, но программа всё равно заходит в тело вложенного условия....

Ложные срабатывание функции Click()
Никак не дойдет до меня. Есть три красных кубика, нажимаем на первый - появляется кнопка &quot;Нажми...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru