Solved

Hook COM port in Win9x & Win2000

Posted on 2002-07-07
29
994 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
[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
  • 8
  • 8
  • 7
  • +3
29 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 7137074
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
ID: 7139370
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
ID: 7139797
>> 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ndthang
ID: 7142217
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
ID: 7149563
0
 
LVL 5

Expert Comment

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

Roberto.
0
 

Author Comment

by:ndthang
ID: 7153627
Different far from my question!
0
 
LVL 5

Expert Comment

by:rmaranhao
ID: 7154035
Sorry for that.
0
 
LVL 5

Expert Comment

by:rmaranhao
ID: 7154040
Sorry for that.
0
 
LVL 5

Expert Comment

by:rmaranhao
ID: 7161871
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
ID: 7166525
As a first step you can try my TVicCommSpy (not free, sorry): www.entechtaiwan.com/commspy.htm
0
 

Author Comment

by:ndthang
ID: 7168554
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
ID: 7169210
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
ID: 7169230
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 2

Expert Comment

by:ivi
ID: 7169262
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
ID: 7169850
Ivi,
I'm waiting for your next post.

Yours,
rmaranhao.
0
 
LVL 2

Expert Comment

by:ivi
ID: 7179593
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
ID: 7180251
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
ID: 7183131
I am trying your component and what about in windows 9x
0
 
LVL 2

Expert Comment

by:ivi
ID: 7184290
Still working on 9x driver.
0
 
LVL 2

Expert Comment

by:ivi
ID: 7184340
Still working on 9x driver.
0
 
LVL 2

Expert Comment

by:ivi
ID: 7190230

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

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

Expert Comment

by:ivi
ID: 7190240

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

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

Expert Comment

by:CleanupPing
ID: 9343095
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
ID: 9350436
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
ID: 9351044
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
ID: 9460287
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
ID: 9463274
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
ID: 9465003
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
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…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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