всем привет!
Возможно ли перехватить исходящие TCP пакеты на VB6 ? если да, то как?
alibek писал(а):В принципе, можно. Почитай про WinPcap. Но это не совсем VB.
Исключительно на VB нельзя.
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Any, ByVal _
wParam As Any, ByVal lParam As Any) As Long
Private Type NetType
LinkType As Long
LinkSpeed As Long
End Type
Dim fAddress As Long
Dim mBuffer As String
Dim LenBuffer As Long
Dim HandleLib As Long
Dim lpAdapter As Long
Dim RetVal as Long
Dim NetInfo as NetType
Private Sub Form_Load()
mBuffer = Space(MAX_PATH)
LenBuffer = Len(mBuffer)
HandleLib = LoadLibrary("packet.dll")
fAddress = GetProcAddress(HandleLib, "PacketGetAdapterNames")
CallWindowProc fAddress,StrPtr(mBuffer), VarPtr(LenBuffer), 0&, 0&
fAddress = GetProcAddress(HandleLib, "PacketOpenAdapter")
lpAdapter = CallWindowProc(fAddress, StrPtr(mBuffer), 0&, 0&, 0&)
fAddress = GetProcAddress(HandleLib, "PacketGetNetType")
RetVal = CallPacketGetNetType(fAddress, lpAdapter, VarPtr(NetInfo), 0&, 0&)
RetVal = CallWindowProc(fAddress, lpAdapter, VarPtr(NetInfo), 0&, 0&)
'Структура пустая, хотя функция возвращает 1
FreeLibrary HandleLib
MsgBox mBuffer
End Sub
Сейчас этот форум просматривают: AhrefsBot и гости: 51