Solved

Trace/track socket messages

Posted on 2003-12-10
4
241 Views
Last Modified: 2010-04-05
0
Comment
Question by:mgazza
4 Comments
 

Accepted Solution

by:
stzizza earned 20 total points
ID: 9916686
First off let me say this can't be done easily in Delphi. Mainly because if you want to do this right you would have to right a kernel mode driver which can't be done with Delphi. That being said you have a few options (depending on the platforms you wish to excecute your code on) . You could write an NDIS driver which would perform all raw network IO, refer to Windows NT or 2000 DDK. You could also write an NDIS intermediate driver or NDIS filter driver that sits between the NDIS protocol driver and the NIC adapters driver (this actually hooks  jump events in NDIS's drivers protocol table) eg. replaces the jump address for fx xyz with its own. Finally you could use a TDI filter which uses the NT legacy interface for TDI.  

Your next option would be to write a User Level "hook" using the Winsock Layered Sercvise Provider (LSP) search for this in the MS Platform SDK I think there is an example you could implement in Delphi. Next you could use the Windows 2K packet filtering protocol to do this I have an example in C from the WDJ if you would like. Next you could replace the Winsock layer with your own implementation of the winsock.dll where you could filter out packets. This would be tedious but could be done. You would have to write a dll that reproduced all the exports from winsock and where you would do your stuff then load the real dll say winsock2.dll passing the parameters verbetum as they would be passed to you.

Finally and the option I suggest is to find a component (try torry.net) that wrappers an NDIS dirver with events that are linked to call backs or something like this I've seen a few. Here is an ocx link - Ive seen a vcl link but can't remember it. Also check out project Jedi they have an IPHelper wrapper for low level ip programming.
http://www.datawizard.net/Free_Software/SocketView_Free/ socketview_free.htm
0
 
LVL 1

Author Comment

by:mgazza
ID: 9919381
i found what i want in c++ but i dont think it lets me sink or swim the packers or read them but it does alow me to know when a packet has been read

http://www.mgazzasodft.150m.com/Downloads/NetHook.zip
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question