1 wdp : http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip
2 Mingw:http://www.mingw.org/
3 pycap: http://code.google.com/p/pypcap/
4 sendpkt: http://code.google.com/p/sendpkt/
5 dpkt: http://code.google.com/p/dpkt/
安装pycap
首先下载 http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip
下载pypcap源代码包pypcap-1.1,解压
1)如果没有安装mingw32 下载安装一个 假设安装到c:\wingw32
2) 设置环境变量 path=%path%;c:\wingw32\bin
3)将上面下载的WpdPack(winpcap development pack) 解压到c:\WpdPack
4)进入pypcap-1.1解压的目录,依次执行:
> python .\setup.py config --with-pcap="C:\WpdPack"
> python .\setup.py build -cmingw32
> python .\setup.py install
1 安装mingw32, 确认mingw32\bin在path里
2 安装wincap
3 mingw-get install pexports
4 D:\Python27\Lib\distutils\cygwinccompiler.py 里删除 -mno-cygwin
5 cd D:\Python27\libs\
6 pexports c:\WINDOWS\system32\python27.dll > python27.def
7 dlltool -d python27.def -l libpython27.a
8 dpkt不依赖于WpdPack, 但是可能会出现错误提示
9 请将dpkt目录下ip.py 此行注释掉 #IP_PROTO_VISA = 70 # VISA Protocol
10 新建文件 setup.cfg
11 [build]
12 compiler=mingw32
13 setup.py build
14 setup.py install
15 sendpkt,pycap,WpdPack目录并列,分别进入sendpkt和pycap目录里执行10-14步
参考
http://www.cnblogs.com/up1m/archive/2012/06/28/2566604.html
http://www.cnblogs.com/babykick/archive/2011/12/26/2302286.html
http://www.iteye.com/topic/600032