Solved

Trace/track socket messages

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

Accepted Solution

by:
stzizza earned 20 total points
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now