• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1042
  • Last Modified:

Hook COM port in Win9x & Win2000

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
ndthang
Asked:
ndthang
  • 8
  • 8
  • 7
  • +3
1 Solution
 
MadshiCommented:
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
 
ndthangAuthor Commented:
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
 
MadshiCommented:
>> 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ndthangAuthor Commented:
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
 
rmaranhaoCommented:
0
 
rmaranhaoCommented:
AsyncFree has a COM component that works on my computer (W2k).

Roberto.
0
 
ndthangAuthor Commented:
Different far from my question!
0
 
rmaranhaoCommented:
Sorry for that.
0
 
rmaranhaoCommented:
Sorry for that.
0
 
rmaranhaoCommented:
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
 
iviCommented:
As a first step you can try my TVicCommSpy (not free, sorry): www.entechtaiwan.com/commspy.htm
0
 
ndthangAuthor Commented:
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
 
rmaranhaoCommented:
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
 
iviCommented:
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
 
iviCommented:
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
 
rmaranhaoCommented:
Ivi,
I'm waiting for your next post.

Yours,
rmaranhao.
0
 
iviCommented:
Well, you can download TVicCommFilter (quick&dirty beta):

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

See readme.txt for some details.
0
 
rmaranhaoCommented:
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
 
ndthangAuthor Commented:
I am trying your component and what about in windows 9x
0
 
iviCommented:
Still working on 9x driver.
0
 
iviCommented:
Still working on 9x driver.
0
 
iviCommented:

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

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

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

http://www.entechtaiwan.com/files/commfilt.zip
0
 
CleanupPingCommented:
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
 
ndthangAuthor Commented:
I can not accept any answer. Please read original my question. (And I want some code in Delphi!)

0
 
MadshiCommented:
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
 
Lukasz LachCommented:
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
 
ndthangAuthor Commented:
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
 
MadshiCommented:
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!

  • 8
  • 8
  • 7
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now