當前位置:編程學習大全網 - 網站源碼 - VB的截取封包和發送封包源碼

VB的截取封包和發送封包源碼

參考資料:

VB截取封包 關於VB開發外掛 尤其是API HOOK方面的分歧較多 其實vb做外掛壹點也不遜色!

上過MSDN的開發者都知道 vb vc c# vj的樣例是統壹的 僅僅是語法表達不壹樣罷了!也就是說用VC寫的功能 同樣也能用VB寫出來!

下面提供壹段VB利用API截獲RAW SOCKET封包的代碼,請不吝賜教!

Dim soc As Long, dwRc As Long

Dim RemoteAddr As sockaddr

Dim LocalAddr As sockaddr

Dim inBuffer, outBuffer As String

Dim byteReturn As Long

Dim RetMsg As String

Dim strData As String

Dim nReceived As Long

Const MAX_PACK_LEN = 4096

Dim keepRun As Boolean

Dim asc() As Byte

Private Type TcpHeader 'typedef struct tcp_hdr //定義TCP首部

th_sport As Integer '; //16位源端口

th_dport As Integer '; //16位目的端口

th_seq As Long '; //32位序列號

th_ack As Long '; //32位確認號

th_lenres As Byte '; //4位首部長度/6位保留字

th_flag As Byte '; //6位標誌位

th_win As Integer '; //16位窗口大小

th_sum As Integer '; //16位校驗和

th_urp As Integer '; //16位緊急數據偏移量

End Type

........ 資料地址: /zyq0ting/blog/item/ab10783eca88783b70cf6ceb.html

  • 上一篇:湘潭天盛建築工程有限公司怎麽樣?
  • 下一篇:tg錢包怎麽用
  • copyright 2024編程學習大全網