【推荐阅读:CComboBox控件详解】
bool firstpacket = true; //用于标记第一个包是否已经发送 【扩展信息:工作两年(一)——进入Compiler的】bool usersended = false; //用于标记是否发送过密码bool online = false; // 是否在线的标记hwnd howner = 0; // 界面的窗体句柄pcap_t *fp = null; // 网卡设备初始化各种待发送的包,略(包结构参考有关资料)unsigned char connectbuf[60] 请求连接包unsigned char disconnectbuf[60] 请求断开包unsigned char unknowbufa[67] 我不知道的包unsigned char passwordbuf[60] 包含密码.用户名的包unsigned char keepbuf[60] 保持连接的包,包含ip.用户名unsigned char sendusernamebuf[60] 发送ip.用户名的包
//打开网卡,用pcap_findalldevs()获得*devicebool opendevice(char* device) { char errbuf[pcap_errbuf_size]; //抓取的最大包的字节为60, 20ms抓取一次 if ((fp = pcap_open_live(device, 60, 1, 20, errbuf)) == null) return false; return true; }
void closedevice()// 关闭网卡{ if (fp != null) { pcap_close(fp); } }
... 下一页