Link to home
Start Free TrialLog in
Avatar of ndthang
ndthang

asked on

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!
Avatar of Madshi
Madshi

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.
Avatar of ndthang

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ndthang

ASKER

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

Roberto.
Avatar of ndthang

ASKER

Different far from my question!
Sorry for that.
Sorry for that.
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
As a first step you can try my TVicCommSpy (not free, sorry): www.entechtaiwan.com/commspy.htm
Avatar of ndthang

ASKER

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

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

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.

Ivi,
I'm waiting for your next post.

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

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

See readme.txt for some details.
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

Avatar of ndthang

ASKER

I am trying your component and what about in windows 9x
Still working on 9x driver.
Still working on 9x driver.

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

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

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

http://www.entechtaiwan.com/files/commfilt.zip
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.
Avatar of ndthang

ASKER

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

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.
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
Avatar of ndthang

ASKER

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