This is our old Q&A Site. Please post any new questions and answers at

can anybody paste a sample c++ or c code to decode the data captured from wireshark ??

asked 26 May '11, 23:42

sagu072's gravatar image

accept rate: 0%

retagged 27 May '11, 20:43

helloworld's gravatar image


the source-code for wireshark or tshark is freely available sample code that does exactly what you want.

permanent link

answered 27 May '11, 00:21

martyvis's gravatar image

accept rate: 7%

edited 27 May '11, 00:21

This is the tutorial I used to learn libpcap capture, parse. Save Wireshark data as pcap and parse it with this code.

permanent link

answered 27 May '11, 00:23

jakan's gravatar image

accept rate: 0%

edited 27 May '11, 00:23

There are several resources that show you how to write your own Wireshark dissector. The difficulty level depends on the chosen language. I prefer Lua because it's easier to work with (other than debugging for which I rely on print-outs to the console), Lua doesn't require installing a bunch of packages to setup a build environment; Lua just needs a Wireshark installation.

Writing a dissector in C:

Writing a dissector in Lua:

permanent link

answered 27 May '11, 20:42

helloworld's gravatar image

accept rate: 28%

edited 27 May '11, 20:45

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 26 May '11, 23:42

question was seen: 5,972 times

last updated: 27 May '11, 20:45

p​o​w​e​r​e​d by O​S​Q​A