Solved

Trace/track socket messages

Posted on 2003-12-10
4
246 Views
Last Modified: 2010-04-05
0
Comment
Question by:mgazza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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