Search code examples
wiresharkwireshark-dissector

Compiling Wireshark packet dissector


I want to build a Wireshark packet dissector of my own and followed the procedure given at https://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html .

However, I do not understand how to compile my dissector and place the dll in the plugins folder. I followed this guide https://www.sewio.net/open-sniffer/develop/how-to-compile-your-wireshark-dissector/ till step 2. But couldn't understand what to do at step 3.

I tried running nmake but it shows no such cmd command. I am using the Wireshark installation for Windows.

How can I compile my dissector and run it? Also is it necessary to build Wireshark from Source code in order to run custom packet dissectors?


Solution

  • First, since you're working on the Windows platform, you should be sure to read and follow very carefully the official Win32/64 Step-by-Step Guide section of the Wireshark Developer's Guide.

    Second, if you're building a plugin, you should be sure to carefully read the README.plugins file.

    You will need to compile the Wireshark sources if you're building a dissector written as a C plugin or builtin, but you won't need to build the Wireshark sources if you write your dissector as a Lua plugin. If you're interested in Lua, you might start at the Wireshark Lua wiki page.

    There's also another less well-known method of building a dissector using 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".