SuperAPI AI Directory

usb-rea

usb-rea is an open-source tool for reverse engineering USB devices. It can infer command and protocol structures from pcap/pcapng files captured by usbmon or USBPcap, and generate Markdown reports and standalone pyusb drivers. It targets peripherals that only have a Windows vendor application, such as fan controllers, RGB controllers, mice, or smart lights, and can be tried without hardware. The tool provides a CLI and an MCP server, and supports labeled actions, inferred replies, handshakes, image streams, HID, and more. It is currently an alpha version (v0.7.15) and has been validated on synthetic devices, protocols documented by open-source projects, public captures, and real-device captures.

Open website

About this tool

usb-rea is a command-line tool and MCP server for protocol reverse engineering of USB peripherals. Its core purpose is to read USB capture files (pcap or pcapng, from usbmon or USBPcap), go beyond Wireshark to infer commands and protocol structures from labeled actions, and output Markdown reports and standalone pyusb drivers.

Main capabilities include: recovering command byte sequences from captures (for example, the NZXT Kraken X fan command 02 4d <channel> 00 <duty>, consistent with liquidctl's kraken2.py; the SteelSeries Rival 100 DPI, polling, and RGB tables consistent with rivalcfg); generating working pyusb drivers; linking every conclusion in the report to a Wireshark frame number; supporting the --try option to load the generated driver and drive a simulated device for validation; supporting a lookup command to check whether an open-source project already implements a protocol for a VID:PID; and supporting scenarios such as labeled actions, replies, handshakes, image streams, and HID.

Usage: on Arch Linux, install with pipx install usb-rea; on Windows, capture with USBPcap, or use a Windows virtual machine on Linux. For real devices, label each click in the vendor application, then run inference; without labels, actions can be listed in order and the tool will split the traffic at pauses. See the usage document for full CLI usage.

Use cases: interoperability reverse engineering of peripherals that only provide a Windows vendor application (such as case LCDs, RGB controllers, mice, smart lights, AIO liquid-cooler LCDs, etc.). The tool only analyzes traffic from devices the user owns and does not redistribute vendor code.

Limitations and status: currently an alpha version (v0.7.15, released on PyPI). Validation covers synthetic devices, protocols documented by liquidctl/rivalcfg/turing-smart-screen-python, public Wireshark captures, and real AIO liquid-cooler LCD captures shared by users. Linear fits must pass leave-one-out cross-validation, otherwise the tool falls back to a lookup table and explains why. Matching a USB ID alone cannot prove that a device usesthe same protocol. Reverse engineering for interoperability is permitted under EU Directive 2009/24/EC Art. 6 and US DMCA §1201(f). The MCP registration name is io.github.emirmrkaljevic/usb-rea.