Solved

Hook COM port in Win9x & Win2000

Posted on 2002-07-07
29
981 Views
Last Modified: 2008-02-01
I want to hook COM port to monitor and modify data exchange from application to COM port.

How can I do that? And I want some code in Delphi!
0
Comment
Question by:ndthang
  • 8
  • 8
  • 7
  • +3
29 Comments
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
I guess in NT based systems you need to write a little driver to do the hooking. You can't write drivers in Delphi, well, at least not seriously.
0
 

Author Comment

by:ndthang
Comment Utility
Where can I find a driver to hook COM port? And How can I write code to use that driver in Delphi?

In Win98, How can I hook COM port using Delphi?
0
 
LVL 20

Accepted Solution

by:
Madshi earned 500 total points
Comment Utility
>> Where can I find a driver to hook COM port?

Perhaps there's something on www.sysinternals.com. Don't know whether you're allowed to use their stuff, though. I guess, you're not.

>> And How can I write code to use that driver in Delphi?

That depends on the driver. Generally by using DeviceIoControl.

>> In Win98, How can I hook COM port using Delphi?

I think the usual way is to write a little driver again (a different driver than the one for NT). Perhaps you can solve it by using system wide API hooking, but that would perhaps be even more difficult than writing a driver.

Regards, Madshi.
0
 

Author Comment

by:ndthang
Comment Utility
On www.sysinternals.com, there is only program to capture data from COM port, no driver!!!

I want to capture and modify data stream on COM port.

Waiting for answer....
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
AsyncFree has a COM component that works on my computer (W2k).

Roberto.
0
 

Author Comment

by:ndthang
Comment Utility
Different far from my question!
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
Sorry for that.
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
Sorry for that.
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
ndthang,

I was lurking at this question hoping to understand what did you want.

I understood that you wanted to take control of a serial port (COM) of your computer and look at what came to it.

Then you would do something with this data and send it to the other port, in order to modify the data.

How far is that from what you really wanted?

Regards,
Roberto
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility
As a first step you can try my TVicCommSpy (not free, sorry): www.entechtaiwan.com/commspy.htm
0
 

Author Comment

by:ndthang
Comment Utility
Dear ivi,

TVicCommSpy is only monitor data send and receive. I want to modify and insert some data into data stream send and receive.

Regards,
ndthang

0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
This is a comment based on my knowledge, without any research, and as so may be wrong.

AFAIK, there's no way you can monitor AND change the data coming through a serial port.
First, how are you going to connect the serial cable?
Second, how are you going to prevent the original and untempered data from reaching the destination conputer?
Third, you you want something to change your data, you might as well tell us what do you want to do with it. I still can't figure out hy my first comment was so different from your question, and no comment from you has been provided on that matter.

The more information you provide the best the answers will be.

Please disregard this information if you know better about serial communication.

rmaranhao
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility
rmaranhao, I would not agree, sorry.
It is possible to monitor and change the coming or outgoing serial port activity at driver level. Some troubles if you want change the size of information, but it is possible also.
Right now I am working on it, so I hope I can issue this stuff soon.

0
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.

 
LVL 2

Expert Comment

by:ivi
Comment Utility
rmaranhao, I would not agree, sorry.
It is possible to monitor and change the coming or outgoing serial port activity at driver level. Some troubles if you want change the size of information, but it is possible also.
Right now I am working on it, so I hope I can issue this stuff soon.

0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
Ivi,
I'm waiting for your next post.

Yours,
rmaranhao.
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility
Well, you can download TVicCommFilter (quick&dirty beta):

http://www.entechtaiwan.com/files/commfilt.zip

See readme.txt for some details.
0
 
LVL 5

Expert Comment

by:rmaranhao
Comment Utility
Ivi,
can't give you an A since I don't control the question, but Congratulations!!

Yours,
RMaranhao.

PS.: Still lurking and waiting for version 1.0

0
 

Author Comment

by:ndthang
Comment Utility
I am trying your component and what about in windows 9x
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility
Still working on 9x driver.
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility
Still working on 9x driver.
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility

TVicCommFilter demo for Win9x/nt/2000/xp beta:

http://www.entechtaiwan.com/files/commfilt.zip
0
 
LVL 2

Expert Comment

by:ivi
Comment Utility

TVicCommFilter demo for Win9x/nt/2000/xp beta:

http://www.entechtaiwan.com/files/commfilt.zip
0
 

Expert Comment

by:CleanupPing
Comment Utility
ndthang:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 

Author Comment

by:ndthang
Comment Utility
I can not accept any answer. Please read original my question. (And I want some code in Delphi!)

0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
Hi ndthang,

maybe this helps:

http://help.madshi.net/madCodeHook.htm

Easy to use system wide API hooking for both win9x and winNT. One of my customers has realized a COM hook using madCodeHook. Look here for some demos:

http://madshi.net/MCHDemos.zip

madCodeHook is free for non-commercial purpose (only).

Regards, Madshi.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
Comment Utility
ndthang,
No comment has been added lately (17 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to Madshi http:#7139797

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0
 

Author Comment

by:ndthang
Comment Utility
I want to hook COM port to monitor and modify data exchange from application to COM port.

How can I do that? And I want some code in Delphi!
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi
some code in Delphi

Thanx
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
I don't have time to write custom code for you. But if you look at the demos which ship with madCodeHook, you should be able to do it yourself. It's not that difficult.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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

10 Experts available now in Live!

Get 1:1 Help Now