zoukankan      html  css  js  c++  java
  • Windows下安装使用Pypcap

    在百度和google上这方面的资料也很少。而且都还是用python2.7+WinPcap的方案

    安装时遇到很多问题 便记录了下来

    运行pip3 install pypcap时出现错误提示

    TypeError: expected str, bytes or os.PathLikeobject, not NoneType
    pcap.h not found 

    https://nmap.org/npcap/#download 安装Npcap 并下载Npcap SDK

     将下载的SDK解压到 python目录里的include 

    将npcap-sdk-0.1 文件夹名字改成wpdpack 

    pcapy模块的安装也可以参照该文,不过安装pcapy需要将wpdpack放置到C盘

    重试安装报了

    error:Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++
    BuildTools": http://landinghub.visualstudio.com/visual-cpp-build-tool

    打开http://landinghub.visualstudio.com/visual-cpp-build-tools 安装Visual C++ 2015 Build Tools

    重试装pypcap

    由于安装时我没有选择SDK后来爆了个错误

    fatalerror C1083: Cannot open include file: 'basetsd.h': No such file or directory
    

      我选择装Windows10 SDK解决

    继续安装pypcap报

        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_freealldevs
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_datalink
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_dispatch
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_setfilter
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_open_live
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_geterr
        pcap.obj : error LNK2001: unresolved external symbol __imp_bpf_filter
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_sendpacket
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_findalldevs
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_open_offline
     
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_compile
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_close
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_snapshot
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_freecode
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_lookupnet
        pcap.obj : error LNK2001: unresolved external symbol __imp_pcap_stats
        pcap_ex.obj : error LNK2001: unresolved external symbol __imp_pcap_next_ex
        pcap_ex.obj : error LNK2001: unresolved external symbol __imp_pcap_getevent
        pcap_ex.obj : error LNK2001: unresolved external symbol __imp_pcap_setmintoc
    opy
        buildlib.win-amd64-3.6pcap.cp36-win_amd64.pyd : fatal error LNK1120: 19 un
    resolved externals
    

      检查执行的命令,翻看下链接库

    发现includewpdpackLib 发现里面还有个64位的版本,将里面的文件复制出来覆盖了

    再次编译安装 终于通过



    亲测有效::

    转载:https://blog.csdn.net/weixin_39078597/article/details/78995012

     

  • 相关阅读:
    day006 数字类型和字符串类型的内置方法
    awk技巧 nginx access.log
    测试访问速度
    ELK Deployed
    jenkins权限控制
    linux 系统优化
    nginx 刷新显示404
    虚拟机安装的ubutun全屏
    在线生成二维码
    GIT 命令集
  • 原文地址:https://www.cnblogs.com/Mengchangxin/p/9494489.html
Copyright © 2011-2022 走看看