Solved

Intercept serial port communication

Posted on 2001-08-06
7
401 Views
Last Modified: 2013-11-15
Hi,

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
trance_creator@zonnet.nl
0
Comment
Question by:trance_creator
  • 3
  • 3
7 Comments
 
LVL 86

Expert Comment

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

You can always do that usina API hooking - see http://research.microsoft.com/sn/detours/ and http://msdn.microsoft.com/msdnmag/issues/1000/vtrace/VTrace.asp on this issue.

BTW: A great tool that already does what you want to is http://www.sysinternals.com/ntw2k/freeware/portmon.shtml
0
 
LVL 1

Expert Comment

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

Expert Comment

by:jkr
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...
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 1

Expert Comment

by:RideOn
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...
0
 
LVL 86

Accepted Solution

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

Well, that works - but it's easier to use http://www.sysinternals.com/ntw2k/freeware/portmon.shtml 
0
 
LVL 1

Expert Comment

by:RideOn
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
0
 

Author Comment

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

TTYL,

Bart van der Vliet
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Browsers Start Page Hijacker 14 139
Arduino EDI - Programming language 3 89
Eclipse IDE - Cannot copy/paste from console output 8 183
Software to generate custom JPGs 12 113
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

815 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

14 Experts available now in Live!

Get 1:1 Help Now