In this post
Key takeaways
- usb-rea captures with USBPcap or usbmon while you label actions in the vendor app, then infers constants, counters, lookup tables and CRCs.
- It outputs a Markdown report, a standalone pyusb driver and a Wireshark Lua dissector, and can run as an MCP server for an AI assistant.
- Run
usb-rea lookup VID:PIDfirst; your device may already be supported by liquidctl or rivalcfg. - The demo mode runs the whole pipeline on an emulated fan so you can try it without hardware.
- A matching USB ID does not prove the same protocol; verify generated packets against the real device before trusting the driver.
Every hardware tinkerer has a drawer with a gadget that only works with a Windows program. The vendor app talks to the device over USB, nobody published the protocol, and Linux support never arrives. The classic fix is to capture the traffic with Wireshark and hand-write libusb code that replays the USB Request Blocks, minding the timings. That works, but it is slow, error-prone work.
usb-rea, an MIT-licensed tool by developer Emir Mrkaljevic, automates most of that pipeline. It captures USB traffic with USBPcap or usbmon while you click through the vendor app, infers the command structure (constants, counters, value fields, lookup tables, CRCs), and writes a Markdown protocol report plus a standalone Linux driver based on pyusb. It also generates a Wireshark Lua dissector and can run as an MCP server so an AI coding assistant can drive the analysis (1).
Check for an existing driver first
Before capturing anything, run the lookup command with your device's VID:PID. usb-rea reports whether an open-source project already documents the protocol. In one example, usb-rea lookup 0416:7395 identifies a Lian Li GA II LCD screen (Winbond Electronics Corp.) as documented by liquidctl, and points at the driver source. In that case you do not need usb-rea at all (1).
liquidctl alone covers a long list of AIO liquid coolers, fan and LED controllers, power supplies and RGB hardware, including the ASUS Ryujin II 360, the Corsair Hydro and iCUE Elite families, the Lian Li GA II LCD and Lian Li Uni fan controllers, and NZXT Kraken models from the X42 up to the 2024 Elite RGB (liquidctl GitHub).
SteelSeries mice have a similar story. rivalcfg is a Python library and CLI that configures SteelSeries gaming mice on Linux, macOS and Windows, covering Rival, Sensei, Aerox and Prime models. It was made by reverse engineering the devices and is not supported by SteelSeries (rivalcfg GitHub).
Note the caveat the tool itself prints: a matching USB ID alone does not prove your unit speaks the same protocol. Check the project's notes for your specific device before assuming support (1).
Install and try the demo
usb-rea installs with pip. The documented steps on Ubuntu 26.04:
bash python3 -m venv .venv source .venv/bin/activate pip install usb-rea
You can try the whole pipeline with no hardware at all using the demo mode, which generates a synthetic capture of an emulated device and runs it end to end (1):
bash usb-rea demo --device fan
The demo writes three files into usb-rea-demo/: report.md (the protocol report), fan_driver.py (the pyusb driver) and fan.lua (the Wireshark dissector). Reading the report before you touch real hardware is the fastest way to learn what the output looks like.
Capture while you label actions
The core workflow is a labeled capture. You start the capture with usb-rea capture, which uses usbmon on Linux or USBPcap on Windows, then you use the vendor app while marking what you are doing or what the app shows, for example "seen rpm 1180 temp 34" or "seen mode turbo". The mark command exists for exactly this (1).
Good labels are the difference between a usable inference and noise. Cover the full range of values you care about: multiple fan speeds, several colors, each mode. If the app shows a reading, label it when you see it, since those observations let the tool tie reply bytes to real values.
One extra trick from the command list: the testcard command writes a test card picture you show on screen while capturing, so the report can tell RGB from BGR in color commands. That is a classic source of wrong-color bugs, and it is worth doing for any RGB device (1).
If your goal is a Linux driver from a Windows-only app, capture with Wireshark or USBPcap on Windows, then run the analysis with usb-rea on Windows, Linux or macOS. The project's "Capture Windows" page walks through that step by step (1).
What the inference actually finds
The demo output shows what the tool looks for in each command. For an emulated fan it recovered mode, fan and color commands, each with a constant header byte (0x5a), a counter that increments once per message, a command byte, the value encoding, and a trailing u16le crc16_modbus over the first six bytes. For the mode field it found a lookup table: 1 maps to 0x11, 2 to 0x22 and 3 to 0x47 (1).
It also recovered the handshake: three messages sent once when the app opens the device, with a token from the first reply reused in the second message, and some messages resent later when the session was reopened (1).
The command set is worth knowing for planning:
capture: start/stop a usbmon or USBPcap capturemark: label the action you are about to do, or what the app shows nowtransfers: list parsed transfersinfer: infer the protocol to JSONreport: write the Markdown evidence reportscaffold: write the pyusb driverdissector: write a Wireshark Lua dissectorhid: decode a HID report descriptor from a capture or hexreplay: send one packet to a real device (requires--yes)lookup: check if the VID:PID is already documentedmcp: run the MCP server over stdio
The transfers command is your first sanity check after a capture. Look at the parsed list before running infer, and confirm the labels landed where you expected (1).
Validate the generated driver
The most convincing result reported so far: on the NZXT Kraken X AIO cooler, usb-rea reportedly recovers the same fan command liquidctl sends, byte for byte, and the generated driver reportedly produces correct packets for values it never saw in the capture. The developer also tested it with the SteelSeries Rival 100, and both devices are already supported by existing Linux tools, which made verifying the results much easier (1).
For your own device, build the same confidence step by step. Use the replay command (which requires an explicit --yes) to send a single packet to the real device and watch the reaction before running a whole driver. Compare replies against the report's predictions: the demo output notes that 24 of 24 "seen" observations matched a reply byte for mode, rpm and temperature, which is the kind of score you want to see on real captures (1).
Pay special attention to values outside the range you captured. The inference gives encodings like u16be round(value * 1 + 0) for fan speed, and a driver that generalizes should produce plausible packets for untested values, but only the device can confirm it. Test the extremes you actually plan to use (1).
Let an AI assistant drive the pipeline
usb-rea can run as an MCP server over stdio, so an AI coding assistant can drive the analysis instead of you typing each subcommand. That fits the tool's shape well: the pipeline is a chain of discrete steps (capture, mark, transfers, infer, report, scaffold), each with a machine-readable output, which is the kind of workflow an assistant can iterate on (1).
Practical ways to use this well:
- Ask the assistant to read
report.mdand challenge each inferred field against the raw transfers, rather than accepting them. - Have it propose test values for
replaythat probe the inferred encodings at the edges of the observed range. - Let it diff the generated driver against the report, since the two should agree on counters, CRC coverage and the handshake order.
Where the old manual method still matters
The traditional approach, capturing with Wireshark and manually implementing URB replay with libusb while watching timings closely, is not dead. usb-rea automates the structure finding, but timing-sensitive protocols, vendor quirks and odd control transfers may still need hand work. The tool's Markdown report is designed as evidence: it documents the handshake, the command tables and the CRC scheme so you can fix the generated driver by hand where the inference falls short (1).
The Wireshark Lua dissector is more than a bonus here. Once your protocol is decoded in Wireshark, you can inspect live captures, compare the vendor app's behavior with your driver's behavior packet by packet, and debug mismatches in a tool you already know (1).
A sensible order of operations
Putting it together, a workflow that avoids wasted effort:
- Run
usb-rea lookup VID:PIDand check liquidctl and rivalcfg support lists first. - If unsupported, capture on the machine where the vendor app runs, labeling every action with
markas you go. - Show the test card if the device has color output, so RGB versus BGR is settled early.
- Run
transfersto sanity-check the capture, theninferandreport. - Read
report.md, question each field, and usereplay --yesfor single-packet tests. - Only then run
scaffoldand exercise the generated pyusb driver against the real device.
The strongest validation path remains a device that already has a community driver. The reported Kraken X result, matching liquidctl's fan command byte for byte, suggests the pipeline can converge on the truth, and that is the standard to hold your own reverse-engineering to (1).
Questions readers ask
Do I need Windows to use usb-rea?
Only for the capture step if your gadget ships a Windows-only app. The capture uses Wireshark or USBPcap on Windows, and the analysis can then run on Windows, Linux or macOS.
How does usb-rea know what a packet means?
You label actions while clicking through the vendor app with commands like "seen rpm 1180 temp 34". The tool matches those labels to packet fields and infers the structure.
Can an AI assistant drive it?
Yes. usb-rea can run as an MCP server over stdio, so a coding assistant can drive the capture, inference and report steps for you.
Has it been verified on real hardware?
The developer tested it on the NZXT Kraken X cooler and the SteelSeries Rival 100, both already supported by liquidctl and rivalcfg, which made checking the output easy.
The AI Hardware Prototyping Stack is a free checklist of tools and prompts.
Circuit Owl Lab wrote this with AI from public sources, and a separate review pass checked its claims against them. Nothing here comes from first-hand testing.