Solved

Hook COM port in Win9x & Win2000

Posted on 2002-07-07
29
985 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
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

786 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