Wireshark
Recently, Wireshark plug-ins need to be developed to analyze a set of protocols. The first problem to be solved is how to compile Wireshark in a Windows environment. Some online materials are also used in the compilation process, however, there are basically some problems. After countless failures, the wireshark compilation was successful.
During compilation, you need the following software: Visual Studio, Python, cygwin, and Wireshark source code.
1. Visual Studio
I am using Visual Studio 2005, which is said to be supported from vc6 to vs2008.
2. Python
Download and install python from 2.4-2.6. I use Python 2.4. Python is used during compilation.
3. cygwin
Download the latest version of cygwin and start installation. The installation process is online. Note that the following libraries must be installed; otherwise, the compilation will be completed smoothly:
Archive / unzipDevel / bisonDevel / flexInterpreters / perlUtils / patchWeb / wget
4. Download Wireshark source code & edit config. nmake
Enter the URL. We recommend that you compile 1.2.7.
After the download is complete, open config. nmake In the wireshark directory. You need to make some settings before compiling.
(1) wireshark_libs: Set the directory where the library required for compiling Wireshark is located. By default, It is enough.
(2) program_files: Set the installation directory of the local program. The default value is enough.
(3) msvc_variant. Because I use vs2005 for compilation, remove the # before the line with the value of msvc2005, and add the # comment out at the beginning of the other msvc_variant lines.
(4) cygwin_path: Set it to the bin directory of cygwin, for example, D:/cygwin/bin.
(5)pythonand its path, and change it to the location of the local python. EXE and its installation directory, for example, D:/python2.4/python.exe.
All other options are default.
(6)Msvcr_dll. If vs is installed on disk D, use absolute paths here instead of modifying the previous program_files. Otherwise, unexpected errors may occur.
5. Compile Wireshark
Use the vs2005 command installed in vs2005 to prompt you to enter or use cmd to enter, and then run vcvars32.bat under VC. Then go to the wireshark directory, and first verify it through the following command:
nmake -f Makefile.nmake verify_tools
If it is correct, the following prompt should be displayed. If it is not a lack of libraries, please install and run the above command until there is no error.
C:/wireshark>nmake -f Makefile.nmake verify_tools Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. Checking for required applications: cl: /cygdrive/e/dev/vc6/VC98/BIN/cl link: /cygdrive/e/dev/vc6/VC98/BIN/link nmake: /cygdrive/e/dev/vc6/VC98/BIN/nmake bash: /usr/bin/bash bison: /usr/bin/bison flex: /usr/bin/flex env: /usr/bin/env grep: /usr/bin/grep /usr/bin/find: /usr/bin/find perl: /usr/bin/perl C:/python24/python.exe: /cygdrive/c/python24/python.exe sed: /usr/bin/sed unzip: /usr/bin/unzip wget: /usr/bin/wget
Then download the library files required during the compilation process:
nmake -f Makefile.nmake setup
In this case, some library files are downloaded and decompressed in the wireshark_libs directory. Finally, run the following command to start compilation. The entire compilation process takes a long time. Please be patient. Do not close the compilation before the system gives a clear prompt.
nmake -f Makefile.nmake all
The entire compilation process ends here. After Wireshark is successfully compiled, we can prepare the plug-in on it.