WinCap 使用心得

最近需要设计网络抓包方面的软件,WinCap在这方面还是挺有名气的,于是下载了一个WinCap 4.02做了点研究由于本人一直在用MFC做一些设计,所以这里就MFC下使用WinCap4.02写点心得,主要目的是总结和帮助新手们更快地入门。
一、配置
第一步:下载官方主页上的WinCap安装包和开发包(Develop)
第二步: 为方便使用把开发包里面的include文件下的.h文件添加入VC6的include文件夹下面,把lib文件夹下面的.lib文件添加入vc6的lib文件夹下面。
好了现在在开发MFC项目的使用要使用wincap只需要在项目文档中加入应用#include "pcap.h",在编译器选项当中增加连接库wcap.lib 和wsock32.lib两个,然和就可以使用wincap提供的函数了。
二、基本的程序
使用wincap最简单的应用是抓包,抓tcp/ip数据包。其他的就先不看了,直接运行开发包里面给的examples,看看文件:pktdump.h
/*
 * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
 * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the dist

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值