编译 Wireshark 数据包解析器

Compiling Wireshark packet dissector

我想构建自己的 Wireshark 数据包解析器并遵循 https://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html 中给出的过程。

但是,我不明白如何编译我的解析器并将 dll 放在插件文件夹中。我遵循本指南 https://www.sewio.net/open-sniffer/develop/how-to-compile-your-wireshark-dissector/ 直到第 2 步。但不明白在第 3 步要做什么。

我试过 运行ning nmake 但它没有显示这样的 cmd 命令。 我正在为 Windows.

使用 Wireshark 安装

如何编译我的解析器并 运行 它?是否有必要从源代码构建 Wireshark 以便 运行 自定义数据包解析器?

首先,由于您在 Windows 平台上工作,因此您应该确保仔细阅读并遵循 Wireshark 开发人员指南的官方 Win32/64 Step-by-Step Guide 部分。

其次,如果您要构建插件,请务必仔细阅读 README.plugins 文件。

如果您要构建以 C 插件或内置形式编写的解析器,您需要编译 Wireshark 源代码,但您不会 如果您将解析器编写为 Lua 插件,则需要构建 Wireshark 源代码。如果您对 Lua 感兴趣,您可以从 Wireshark Lua wiki page 开始。

还有另一种 less well-known 构建解析器的方法,使用 wsgd. I have no experience with wsgd, but for an introduction to all 3 methods, you may wish to review Graham Bloice's presentation from Sharkfest '15 titled, "Wireshark Dissectors - 3 ways to eat bytes"

五个步骤为wireshark制作一个c插件(自定义解析器):

1.编译一次wireshark源码

2. 在 "wireshark\plugins\epan\foo" 目录中创建一个源文件(例如命名为 packet-foo.c )

3.复制另一个插件源文件和配置作为模板并编辑

4.重新编译wireshark源码

5. 启动wireshark并测试

详情可以查看我的post这里show you how to compile the c language plugin for wireshark 3.1 step by step (windows platform 2019-3-20)