0

I'm trying to reverse the protocol used by an early nineties logic analyzer an its PC software. The device is connected via RS-232 (propietary wiring) and communicates with a DOS program, successfully running on DOSBOX.

I'm able to control the device with the original software but it would be useful to autimathe the downloading of data from the analyzer using a custom program but to do so I need to know what is going on the serial port.

Ineed to know what mode is the serial port set, while I know for sure the datarate is either 1200 or 9600 bps (configurable on the device) I don't know the flow control (I guess it is RTS/CTS).
I also need to tap into the conversation between the prgram and the device without disturbing their communication.
Reading the serial port with another program (cutecom/minicom) prevents the emulator from receiving the data from the hardware.

So, summing up, what I need to know is:

  • What configuration is set on /dev/ttyS0 (via IOCTL calls, i think)
  • What goes on between program and device.

I was thinking in programming a library which acts as a proxy for the standard c library (via LD_PRELOAD) but there must be an easier way to do this.

NeonMan
  • 623
  • 10
  • 24

2 Answers2

0

You can use slsnif (Serial Line SNIFfer).

http://linux.die.net/man/1/slsnif

Here's a link to the sourceforge project so you can download it. I don't believe it comes with any modern distributions but I could be wrong so check your distro's software repository first.

http://sourceforge.net/projects/slsnif/

cmevoli
  • 351
  • 2
  • 6
  • slsniff (and may others like interceptty) seem to consume whatever it comes from the serial port without forwarding it correctly to the emulator. I can see what comes from the device but the programs looks like it doesn't receive a thing. – NeonMan Mar 18 '13 at 17:49
  • @NeonMan, be sure to use the unix98 options when you run it because I think that might be causing what you mention. – cmevoli Mar 19 '13 at 01:09
  • interceptty seems to forward traffic just fine (running it to forward RealDev <--> FakeDev1 <--> FakeDev2 <--> {rogram you can catch communication FakeDev1 --> RealDev) however the device does not seem to send anything back. My best guess is that it is because it can't forward ioctls (RS232 signals). Ttyrpld seemed to have potential since it comes with a kernel module but I failed to set it up and looking at the linux driver code it probably doesn't forward ioctls anyway :( . – fakedrake Jan 15 '15 at 11:23
0

I use ttyrpld for tty sniffing. I ported it to PPC and run it on 2.6.32. It logs all of the tty traffic on the board to files, one per tty. Works well.

Jonathan Ben-Avraham
  • 4,615
  • 2
  • 34
  • 37