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, and gives you a report, a driver, and a Wireshark protocol dissector out the back side. There is even an MCP file so that you can hand off the grunt work to the bots, possibly enabling this to work closed-loop?
Of course, you don’t want to reinvent the wheel, so it’s fun to see that there’s also a usb-rea lookup command to see if your VID:PID is already in the dataset. Most of the devices are CPU coolers, RGB controllers, and other blinged-out computer peripherals, but we imagine that it’s a lot more broadly applicable. We looked for our mouse on the list, but it’s sadly not there.
Usb-rea is not a silver bullet to bring back abandoned peripherals from the grave, because you still need to run the proprietary driver during the recording. But if you get ahead of the game and document the protocols before the manufacturers abandon them, you stand a chance. Get recording!

Wireshark has usb capturing built in.. worked well for my purpose
This for CAN traffic would be a godsend.
Hi, I made usb-rea, thanks! CAN is a really interesting idea and I’ll look into it. The tricky part for me is testing: I don’t have a car or any CAN hardware to capture real traffic from. If anyone knows of public CAN captures (candump logs or pcaps) where the messages are already documented, I’d love to use them as test data.
There are plenty of tools for CAN, especially 2.0B, CAN-FD and the rather new CAN-XL are still a bit exotic. I use PCANview al lot, with the live view or parsing the log afterwards, or quickly whip up a python script with python-can if I need anything specific.
Have a Look at https://cantools.readthedocs.io/en/latest/
@Emir Mrkaljevic …well done !!!
If it’s of any help to someone else — I made an RP2040 based MiTM USB “Sniffer” which is particularly handy if your control software only works in older operating systems where modern compatibility makes sniffer challenging. https://github.com/Stephen-Arsenault/usb-sniffer-MCP