Hello,
I use to do programming long time ago, in the DOS era, survived TRS80, Tiny Basic, GWbasic and Quickbasic. Recently I managed to pickup programming Basic style again with Visual Basic Express.
After installing it and playing a bit around, I tried to find an initial setup for a Local area network packet sniffer. Google came up with a package called PackMon.NET and Sniffer.NET from v2softwares http://www.1vbstreet.com/vb/scripts/ShowCode.asp txtCodeId=3881&lngWId=10 . A VB component seems hard to find, there is more C code available. Unfortunately I am sort of illiterate at C.
When I run the package, the list screen doesnt get populated with packets.
Debugging and single stepping confirms a packet is grabbed and stored in the applications internal buffer, I can look at its contents through Quick Watch.
I have multiple times errors in the immediate screen like this
a first chance exception of type 'System.InvalidOperationException' occured in System.Windows.Forms.dll
I have searched the net forwards and backwards but could not find anything to proceed in this matter. Any help thankfully appreciated.
Jake

System.InvalidOperationException in System.Windows.Forms.dll
TimothySr
Hi Vikas,
I tried to compile the downloaded source version for framework2 and this is the error list:
Error 1 Resource file "My Project\Resources.resx" cannot be found.
Error 2 Unable to open module file 'C:\Documents and Settings\.......\Sniffer.NET\My Project\Resources.Designer.vb': The system cannot find the file specified.
Waiting further instructions,
Jake
jim_d
Hmmmm
Tried download...
'The compressed (zipped) Folder is invalid or corrupted'
is as far as I could get.
Could you please verify
Thanks
Jake
Mike Pounds
Hi Vikas,
Thanks for the update, we are getting further.
However I still have questions
1. What is IP address '::1' That is what I see in my list, and consequently, when that address is enabled, errors are being produced.
2. How can I see packet contents I think I see the code part for generating it as 'commented out', and I dont see a form for handling that output. Apology if I am mistaking.
Greetings
Jake
HeavyMetalMan
Thanks Vikas, hope the solution will be available soon
Jake
salm
Hi Vikas
Thank you for replying
I have downloaded the updated code from http://www.1vbstreet.com/vb/scripts/ShowCode.asp txtCodeId=4090&lngWId=10 as you suggested, unzipped and extracted to a new folder, ran vb express on the slnfile PackMon.sln, and de result is the same. This is the output on the immedate window:
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
A first chance exception of type 'System.NullReferenceException' occurred in PackMon.NET.dll
I think the first errors are produced when a packet line is added to the form, also the text on the status bar doesnt update, it keeps the text "Monitoring all interfaces"
Private Sub OnNewPacket(ByVal m As Monitor, ByVal p As Packet) Dim lstItem As ListViewItem = New ListViewItemm_Packets.Add(p)
m_PacketsSize += p.TotalLength
Try With lstItem.Text = p.Time.ToString
.SubItems.Add(p.Protocol.ToString)
.SubItems.Add(p.Source.ToString)
.SubItems.Add(p.Destination.ToString)
.SubItems.Add(p.TotalLength.ToString)
End With Catch ex As ExceptionMsgBox(ex.Message)
End TryPacketList.Items.Add(lstItem) ' error occurs here I think
StatusBar.Text =
String.Format("Intercepted {0} packet(s) [{1} bytes]", m_Packets.Count, m_PacketsSize) End SubI have already switched the status.bar line and the packet.list line, without effect.
I think the last error results from stopping the application.
How can I find more information
Thanks again for helping me
Merry Xmas
Jake
Dandan He
Joe Farah
Hi Jake,
We are very sorry to hear that our code is giving you problems and you are not able to figure it out. Can you please send us the complete trace for the Exception so that we can help you better. you can always contact me at MSN or mail me at vikas@v2softwares.com. i find out that the code you are using is a old version and got few more bugs than the latest one. you can download the latest release from the following url http://www.1vbstreet.com/vb/scripts/ShowCode.asp txtCodeId=4090&lngWId=10 This version also has the feature to show the contents of the packet in seperate window in HEX form.
Thanks and Regards
Vikas Verma
v2Softwares
EvilSpirit
As promised , you can download the code which is compaitible for .Net Framework 2.0 and so for Visual Basic Express Edition 2005. here is the link http://www.v2softwares.com/downloads/sniffer_dotnet2_src.zip
please test it and do let us know if you still face any problem.
creagan
RolandAbt
Sorry for not being able to reply to your question for long as i was out for new year holidays.
As we already said that we are still working on this project , bugs were expected and so we are fixing them as we are finding them. we would definately look into those bugs.
regarding the way to look into for the content of the packet i would like to say that we had made than available to .Net Framework 1.1 and expecting a new release for .Net 2.0 in few hours and you can download the version from our site. http://www.v2softwares.com/
Thanks for showing interest in us and thanks for using our product. Together we can make this a success.
Andrew Sears - T4G
Hi again Vikas,
I have downloaded the binary version from http://www.v2softwares.com/downloads/sniffer.zip and this .exe works.
This being already a great relief that this program is able to run on my machine with this current environment, I have to point out that this is NOT a solution to my problem.
I want to play around with the received packets in vb, starting from a working base in vb - your packet monitor program -, in order to get acqainted with vb express and local area network issues.
I noticed the packmon.net.dll file size was different, so I tried to use the newer dll with the older vb project, the result was the same error.
As for your second suggestion about tracing the error, I am afraid my knowledge doesnt reach far enough at this moment to provide any meaningful feedback.
What can I try next
Thanks for helping me, and probably other people as well :)
Jake
G4_Fighter
Jake,
Were you been able to download the latest code from our site and test it. We have uploaded source and binary for the Sniffer.NET to our website's (http://www.v2softwares.com/) download section for both Framework version 1.1 and 2.0. Please feel free to contact us for any further assistance.
Greg Shaffer
Jake,
I think the error is due to the fact that the Sniffer.NET and PackMon.NET are written for Visual Basic .Net targeting .Net Framework Version 1.1. We havent tested it under Visual Basic Express Edition which uses .Net Framework 2.0. You can download the compiled edition from our site and test if it works fine.
http://www.v2softwares.com/downloads/sniffer.zip
Vikas
Quentin Lee
Jake,
Ok then its for sure problem related to changes in .Net Framework Class Libraries. Give us some time and we would we write the whole code for .Net Framework Version 2.0 and make sure it works for VB Express 2005 Edition.
Thanks for showing interest in Sniffer.NET and letting us know that it has some problems when compiled with Framework 2.0