r/hardwarehacking • • 10d ago

I built an open-source tool that turns a USB capture of a Windows-only gadget into a protocol report and a Linux driver

I kept buying hardware (case LCDs, RGB controllers, fan hubs) that only works with a Windows vendor app, and doing the same reverse engineering by hand every time: capture with USBPcap or usbmon, stare at hex, diff packets, guess which byte is the fan speed and which one is a counter or CRC.

So I built usb-rea to automate the boring part. You capture traffic while you use the vendor app, mark what you did ("set fan to 40%", "set color red"), and it infers the command structure: constant headers, counters, value fields, lookup tables and checksums (it brute-forces common CRC variants). The output is a Markdown protocol report plus a standalone pyusb driver you can run on Linux.

How I checked it without guessing: I run it on public captures of devices whose protocol is already documented. On NZXT Kraken X captures it recovers the same fan command liquidctl sends, byte for byte, and the generated driver builds correct packets for values that never appeared in the capture. There is also a lookup command that checks a VID:PID against about 270 devices that already have an open-source Linux implementation, so you don't redo work someone already did.

It is MIT licensed, pip install usb-rea. It also runs as an MCP server if you want an LLM client to drive the analysis, but the CLI works on its own.

Repo: https://github.com/emirmrkaljevic/usb-rea

Limits, honestly: it is alpha. Linear value fits have to survive a leave-one-out cross-check, otherwise it falls back to a lookup table and says so, and a matching USB ID alone does not prove your unit speaks the same protocol. I would love captures or feedback from devices where it gets things wrong.

4 Upvotes

0 comments sorted by