claymore1977
New member
Okay all, still a newbie poster here, and making the transition from VB6/VBA to VB.net.
I have a simple (or at least I think it simple) project that I am trying to work on. I am trying to create an application that is close to a packet sniffer. I have a client & server software package that I would like to be able to record the data stream between the two. I have done tons of research and came up with the following angles of attack:
Using vb.net I have a class created that contains connect(), listen(), beginreceive(), and send() functions. The class also raises events when Data has arrived on a port, a socket connects, disconnects, or throws an error. I am using a form to initialize two of these classes (ClientSide & ServerSide) and am handling the events from the two classes to swap the data, aka:
ClientSide.onDataArrival(byVal Data() as Byte()) calls the ServerSide.Send(byVal Data() as Byte()) function
ServerSide.onDataArrival(byVal Data() as Byte()) calls the ClientSide.Send(byVal Data() as Byte()) function
My flowpath was planned to be:
I have read soooo many tutorials already that I am now confused. I understand there are many ways to skin this cat, but every tutorial seems to answer 33% of the question, and piecing together a solution from fragments of different approaches has me mentally 'wrapped around the axle'
I can post the code if need be, but I am really looking for advice/tutorials/URLs on any methodolgy I might change/use. I won't be opposed to someone taking my code and 'fixing' it, but that seems kinda the wrong way to tackle this.
Am I even on the right track/right approach? Should I consider using threads to handle each of the sockets?
I have a simple (or at least I think it simple) project that I am trying to work on. I am trying to create an application that is close to a packet sniffer. I have a client & server software package that I would like to be able to record the data stream between the two. I have done tons of research and came up with the following angles of attack:
- create a ws2_32 proxy .dll that dumps all send() and recv() buffers to a text file every time they are called..... but i couldn't get that to work.
- use SoftIce or OllyDbg to hook into the send() and recv() calls... but I couldn't make that work for me either.
Using vb.net I have a class created that contains connect(), listen(), beginreceive(), and send() functions. The class also raises events when Data has arrived on a port, a socket connects, disconnects, or throws an error. I am using a form to initialize two of these classes (ClientSide & ServerSide) and am handling the events from the two classes to swap the data, aka:
ClientSide.onDataArrival(byVal Data() as Byte()) calls the ServerSide.Send(byVal Data() as Byte()) function
ServerSide.onDataArrival(byVal Data() as Byte()) calls the ClientSide.Send(byVal Data() as Byte()) function
My flowpath was planned to be:
- ClientSide Socket listens for connection
- Once connection is recieved, the event ClientSide_OnGetConnect is raised and that causes the Serverside socket to connect to the server.
- CllientSide socket continues on and calls .BeginRecieve
- Once ServerSide Socket connects, it calls its own .BeginRecieve
- Everytime the ClientSide Socket recieves data, it raises the ClientSide_onDataArrival() event, which the Form responds to by calling ServerSide.Send()
- Everytime the ServerSide Socket recieves data, it raises the ServerSide_onDataArrival() event, which the Form responds to by calling ClientSide.Send()
I have read soooo many tutorials already that I am now confused. I understand there are many ways to skin this cat, but every tutorial seems to answer 33% of the question, and piecing together a solution from fragments of different approaches has me mentally 'wrapped around the axle'
I can post the code if need be, but I am really looking for advice/tutorials/URLs on any methodolgy I might change/use. I won't be opposed to someone taking my code and 'fixing' it, but that seems kinda the wrong way to tackle this.
Am I even on the right track/right approach? Should I consider using threads to handle each of the sockets?