How do I intercept messages from a USB device on Linux?

戏子无情 提交于 2019-12-03 04:15:37

问题


I have a popular drawing tablet that I connect to my PC with USB. Once connected, the tablet detects hand movements and manipulates the pointer accordingly. Somewhere, the tablet is transmitting this data to my computer.

My goal is to intercept these transmissions and manipulate the mouse after I process the data. The buzzwords I have found are: device drivers and HID, but I haven't been able to piece together much more than that.

Assuming this is possible, I have a few questions:

  1. How is this done if the data format is known?
  2. How is this done if the data format is unknown/proprietary?

My computer is running Ubuntu (but answers related to any form of a Linux OS are greatly appreciated!).


Note: This question is similar but intended for Windows.


回答1:


Actually you missed a buzzword "USB sniffing". ;-)

Here are a few tutorials on USB sniffing on Linux, to get you started.

  • Official Wireshark wiki for USB monitoring
  • biot.com/blog/usb-sniffing-on-linux (InternetArchive)
  • tjworld.net/wiki/Linux/Ubuntu/USBmonitoring

Essentially you use the usbmon Linux kernel module to capture the USB-packets and Wireshark as a front-end to display and analyse the captured USB stream.



来源:https://stackoverflow.com/questions/18137206/how-do-i-intercept-messages-from-a-usb-device-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!