逆向工程串行通信
我有一个设备,当某个应用程序启动时,它会向该应用程序发送数据。我需要嗅探该数据并检索某些未显示的信息。该设备是定制的,并且由于某种原因没有数据表。因此必须嗅探通信并重建从应用程序发送到该设备的命令。所以我想用 C# 或 C++ 来完成这个任务。现在我已经尝试了所有嗅探软件,是的,他们嗅探了它,但我希望能够实时检索数据并实时呈现。
谢谢
I have a device which when a certain application is on send data to that application. I need to take a sniff that data and retrieve certain information which is not being shown. The device is custom and for one reason or another has no data sheets. So have to sniff the communication and reconstruct the commands being sent from the application to this device. So I would like to accomplish this in C# or C++. Right now I have tried every sniffing software and yes they sniff it but I want to be able to this live and retrieve the data and present it live.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是将您的软件放在设备和其他软件之间。然后,传递所有数据,捕获您需要的任何内容。
为此,您需要使用串行端口环回软件。那里有很多这样的东西。请参阅 http://www.virtual-serial-port.com/ virtual-serial-port-kit.html。我个人使用过 GPSGate 的产品,但我相信有免费环回驱动程序可用。
一种更复杂(但更被动!)的方法是监视 IOCTL。我无法指导你如何做到这一点,因为我不知道,但这是值得研究的事情。 http://www.serial-port-monitor.com/ 上的软件使用此方法。
The easiest way to do this is to put your software in between the device and the other software. Then, pass-through all of the data, capturing out whatever you need.
To do this, you would need to utilize serial port loopback software. There is a lot of it out there. See http://www.virtual-serial-port.com/virtual-serial-port-kit.html. I personally have used a product from GPSGate, but I believe there are free loopback drivers available.
A more complicated (but more passive!) method is to monitor IOCTLs. I can't direct you how to do this, as I do not know, but it is something to look into. The software at http://www.serial-port-monitor.com/ uses this method.
另一种为您提供虚拟串行端口的软件是 com0com (http://com0com.sourceforge.net/)。但是,它还具有集线器功能,可以将设备的输出发送到许多应用程序,这对您可能有用也可能没用,具体取决于您是否只需要监视设备的输出或双向监视。
如果不出意外的话,如果您沿着设备过滤器路线走下去,它可能会为您提供一些开源代码来作为您自己的嗅探器的基础。但如果您沿着这条路线走下去,如果您需要驱动程序签名才能在 64 位版本的 Windows 7 上运行,则可能需要查看驱动程序签名。
An alternative piece of software giving you virtual serial ports is com0com (http://com0com.sourceforge.net/). However, it also has a hub functionality where the output of the device can be sent to many applications, which might or might not be useful to you depending on whether you just need to monitor the output from the device or in both directions.
If nothing else it might give you some open source code to base your own sniffer on if you go down the device filter route. But if you go down that route you might need to look at driver signing if you need it to work on 64 bit versions of Windows 7.