Intercept serial port communication

Posted on 2001-08-06
Last Modified: 2013-11-15

Because I want to understand the protocol in which an application "talks" to external hardware, I need to have a program which intercepts the "talking" and dumps it to a file.

The program must sit and wait until another program writes or retrieves data to or from the COM1: port (it has to run on a Windows 2000 machine).

Is this possible in VISUAL C++ (or in any way at all?). If such a program already exists, please say where I can get it!

Thnx in advance,

Bart van der Vliet
Question by:trance_creator
  • 3
  • 3
LVL 86

Expert Comment

ID: 6356018
>>Is this possible in VISUAL C++ (or in any way at all?).

You can always do that usina API hooking - see and on this issue.

BTW: A great tool that already does what you want to is

Expert Comment

ID: 6356084
You have to use following APIs CreateFile & ReadFile to Read from ComPort.
Do you only want to Read from it?
LVL 86

Expert Comment

ID: 6356140
>>You have to use following APIs CreateFile & ReadFile to
>>Read from ComPort.

But these APIs don't allow to intercept an ongoing communication...
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline


Expert Comment

ID: 6356174
oh yes, thats right
okay, want to know what i did?
i had to monitor the communication over COM1 Port.
I made a patch-cable that was 1:1:1, that means APLLICATION - COM1 - COM2

over COM1 i communicated with the APPLICATION and on COM2 i watched what's happening. I think that's a very easy and fast way to do that...
U can watch COM2 with a normal Terminal-Program like Windows Hyper Terminal...
LVL 86

Accepted Solution

jkr earned 250 total points
ID: 6356191
>>okay, want to know what i did?

Well, that works - but it's easier to use

Expert Comment

ID: 6356247
that's maybe right...but you're a little restricted with that application...
but anyway, maybe it's enough for trance_creator...

grEEz RideOn

Author Comment

ID: 6358384
The program is exactly what I need! Thanks a lot!!!


Bart van der Vliet

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Let’s list some of the technologies that enable smooth teleworking. 
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

760 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

18 Experts available now in Live!

Get 1:1 Help Now