Kind of reverse engineering

Hi everyone,
I'm a linux novice , in a training purpose i have to reconstruct under windows an application running under fedora 14, the application communicates with an STB device through RS232 in a first time and then through ethernet for firmware loading purpose.
All what i know is how to run the application then it shows some informations as "plug the RS232 connecter, restart the STB... " then if done it proceed to send files through RS232 then it reboot the device then it loads other files through ethernet
What i need is to interpret how it communicates with the device, what commands it sends to the device and what it recieves so i can develop my own application in windows, a sort of reverse engineering.

Can you guys help me please?

I'd say that you would want to trace the program. On linux, the strace and ptrace commands would be the tools of choice I'd say. I typically use strace with the '-f' flag to instruct it to follow any child processes it starts.

You'll be able to see any raw writes and reads to the serial device.

To get deeper and actually capture the exact data flow, you'd likely need to create a named pipe, connect that to a script that just dumps all data it seems and then passes it on to the serial port, then point the code you are reverse engineering at your new dummy "serial port" device.

You might also be able to do something crafty with a windows PC and two serial ports. Connect one to the linux host, the other to the STB. Then write a short program to capture all serial traffic on either port, and send it to the other - ie a packet sniffer for serial traffic.
(I say windows just because it sounds like you are more comfortable coding on that)

Thanks for your reply Dragon, yes i was already working on a hardware solution spying the serial connexion, and yes i'm more confortable with windows coz im not a linux expert and i found many difficulties using commands as a novice, and same that i have to work on windows coz the project concerns windows users,
but at the same time i wanted to do the spying stuff with a linux intern software solution coz i like it but... im not able to do so far...
Now i already acheaved some good results using hard solution and i'm moving on.

thanks for your attention :slight_smile: