Click here to Skip to main content
15,905,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using the SharpPcap library to sniff packets on a particular device. I have never really worked with raw sockets before and am a bit confused. I am capturing the packets fine, but now I want to decode the packet data into a string that is readable. Basically, what I want to achieve is reading the raw HTML requests that are being sent and received.

The data I receive is a byte[], and I have tried all of the basic byte[] to string methods with the .Net methods provided. If someone who has used SharpPcap achieved this, or does someone know how to do this?

Thanks in advance,

-Dom
Posted

1 solution

Hi,

I'm quoting from Packet.Net

"Packet.Net is a high performance .Net assembly for dissecting and constructing network packets such as ethernet, ip, tcp, udp etc.

Packet.Net started as a rewrite of the packet parser in SharpPcap with the goal of making a more consistent and better documented API.

Packet.Net now provides the packet parsing functionality for SharpPcap as of SharpPcap v3.0.0."


http://sourceforge.net/apps/mediawiki/packetnet/index.php?title=Main_Page[^]

Absolutly agree, SharpPcap's documentation is very less.

I think you're easily able to achieve it with packet.net api and reading tcp packages.

With Best Regards
 
Share this answer
 
v2
Comments
DominicZA 3-Apr-12 12:15pm    
Thank you, this looks good! I will look into it and mark as answered if it helps me achieve what I need :D

-Dom
El_Codero 3-Apr-12 12:19pm    
Oh, I forgot the link. Solution improved. Thanks for marking it as answer in future ;).

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900