Wireshark源码(3.0)
通过github
wget -c http://codeload.github.com/wireshark/wireshark/zip/master-3.0
解压
我解压到 /opt/project-c/project1/wireshark-master-3.0
安装依赖库
sudo apt-get install libglib2.0-dev
sudo apt-get install libgcrypt20-dev
sudo apt-get install flex bison
sudo apt-get install libssh-dev
sudo apt-get install libpcap-dev
sudo apt-get install libssh-dev
sudo apt-get install libsystemd-dev
sudo apt-get install qmake-qt-gui
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
安装QT5
添加cmake对QT5的目录:CMAKE_PREFIX_PATH=/opt/Qt5.11.2/5.11.2/gcc_64/lib/cmake
编译
通过qmake-qt-gui(cmake的gui版本)
源码路径为: /opt/project-c/project1/wireshark-master-3.0
编译目标为:/opt/project-c/project1/wireshark-master-3.0/build
修改安装目录为:CMAKE_INSTALL_PREFIX=/opt/project-c/project1/wireshark-master-3.0/build/install
在build目录中执行命令:
mkdir build
cd build
cmake ../
使用eclipse-cpp打开源码修改:
使用开源镜像站下载eclipse-cpp:
http://mirror.hust.edu.cn/eclipse/technology/epp/downloads/release/2019-03/M2/
调试:
Ubuntu添加wireshark组运行dumpcap功能root权限
sudo groupadd wireshark
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 4755 /usr/bin/dumpcap
sudo chmod u+s dumpcap
sudo gpasswd -a common wireshark