Proprietary device drivers, dedicated applications, and their ilk are the bane of the open-source hacker. If only we could snoop on every device out there, recording the “secret” USB transactions as they go over the wire, we’d have a chance.
[Emir Mrkaljević]’s tool, usb-rea , aims to make this process a whole lot less painful. The workflow is like this: you start capturing on USB, make an annotation about what action you’re taking, press the button a few times, and then move on to the next action.
sudo modprobe usbmon usb-rea capture start -o lamp.pcapng usb-rea mark -m lamp.pcapng.actions.json "brightness 0%" # then click it in the vendor app usb-rea mark -m lamp.pcapng.actions.json "brightness 50%" # ...repeat for 3+ values per setting usb-rea capture stop usb-rea report lamp.pcapng -o report.md usb-rea scaffold lamp.pcapng -o lamp_driver.py usb-rea dissector lamp.pcapng -o lamp.lua # Wireshark dissector for the same protocol
Usb-rea records all the USB traffic, timestamps it relative to your actions,…