Click here to Skip to main content
13,193,393 members (56,929 online)
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 26 Jan 2005

Simple Packet Sniffer in VC++ .NET

, 26 Jan 2005
Rate this:
Please Sign up or sign in to vote.
This is my first program. I hope it will be useful for someone who wants to write sniffer using WinPcap library.
Sample Image - Sznyfer.jpg


This is my first big program in Visual C++. You can download a packet sniffer which grabs packets from local interface and analyses headers. It also writes headers into the log file.


You must have WinPcap library and .NET installed on your machine. You can download it from here.

Points of Interest

I'm a beginner in Visual, interested in C/C++ programming and digital signal processing. Please write to me if you have any suggestions. My email is


  • 27.01.2005: I put in order using operators "new" and "delete" and uploaded code again.
    I changed Polish comments to English.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Poland Poland
No Biography provided

You may also be interested in...

Comments and Discussions

Questionpacket sniffer Pin
namrata248813-Sep-09 22:13
membernamrata248813-Sep-09 22:13 
QuestionHow to calculate Bit rate? Pin
Taran912-Mar-08 0:12
memberTaran912-Mar-08 0:12 
GeneralRe: How to calculate Bit rate? Pin
Taran912-Mar-08 1:34
memberTaran912-Mar-08 1:34 
Assuming that 'tlen' in structure ip_header gives the length of complete packet in bytes, I've added up the length of packet between the clicking of "Snort" button and "Stop Capturing" button, converted it into bits and divided it by time difference between the two events(used difference of GetTickCounts). But am not getting correct results.

As I've very limited knowledge in this field(I'm doing this kinda thing for the first time), I would really appreciate your inputs for the same

GeneralCompiling Errors Pin
nwongfeiying22-Jan-08 17:50
membernwongfeiying22-Jan-08 17:50 
GeneralRe: Compiling Errors Pin
bunhead13-Mar-08 5:07
memberbunhead13-Mar-08 5:07 
General"fatal error C1021: invalid preprocessor command 'using' Pin
ghassan24117-Aug-07 5:12
memberghassan24117-Aug-07 5:12 
Question"fatal error C1021: invalid preprocessor command 'using' Pin
ghassan24117-Aug-07 5:11
memberghassan24117-Aug-07 5:11 
Questionfatal error C1021: invalid preprocessor command 'using' Pin
ghassan24117-Aug-07 5:10
memberghassan24117-Aug-07 5:10 
Questionwhy not use netmon API? Pin
Anonymous16-Apr-05 1:07
sussAnonymous16-Apr-05 1:07 
AnswerRe: why not use netmon API? Pin
Vertilka The Blue27-Nov-07 2:21
memberVertilka The Blue27-Nov-07 2:21 
GeneralDeleted Message Pin
James_12326-Jan-05 17:49
memberJames_12326-Jan-05 17:49 
GeneralRe: Works Well, One question though.. Pin
defenestration26-Jan-05 19:58
memberdefenestration26-Jan-05 19:58 
GeneralRe: Works Well, One question though.. Pin
maszup27-Jan-05 8:49
membermaszup27-Jan-05 8:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171017.2 | Last Updated 26 Jan 2005
Article Copyright 2005 by maszup
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid