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
Solved

Trace/track socket messages

Posted on 2003-12-10
4
242 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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