A lot of small hardware (AIO cooler screens, RGB hubs, stream decks, case LCDs) only ships a Windows app, and the usual route to Linux support is someone staring at Wireshark for an evening. I built usb-rea to do the step after Wireshark.

You capture with usbmon on Linux or USBPcap on Windows, label what you clicked in the vendor app (brightness 0, 50, 100, fan 30%, and so on), and it infers the command layout: constant headers, which byte follows which setting, counters, checksums like CRC16, lookup tables and image streams. It then writes a Markdown report where every claim points to Wireshark frame numbers, plus a standalone pyusb driver.

On public captures of the NZXT Kraken X it recovers the fan command byte for byte as liquidctl sends it, and the generated driver produces identical packets for values it never saw. It is alpha, MIT, pip install usb-rea, and usb-rea demo --device fan runs without any hardware.

If you have a device that only works on Windows, I am happy to run a capture through it and post the result.

  • definitemaybe@lemmy.ca
    link
    fedilink
    arrow-up
    2
    ·
    14 hours ago

    This is really cool. I was looking into getting a stream deck, but couldn’t find an affordable one with Linux drivers.

    Tools like this give me hope that people who know what they’re doing can make drivers for more devices like that so we can get closer and closer to a “Linux just works” world.

    • emirmrkaljevic@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      7 hours ago

      Thanks. If you go for one of the cheaper decks, check DeckBridge and python-elgato-streamdeck first, a lot of the MiraBox/Ajazz style clones are already covered there, so you might not need to reverse anything.

  • Die4Ever@retrolemmy.com
    link
    fedilink
    English
    arrow-up
    5
    ·
    19 hours ago

    Sounds cool. Could it also be adapted for reverse engineering network protocols? File formats would probably be pretty different functionally but similar strategy.

    • emirmrkaljevic@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      7 hours ago

      Partly. The capture side is USB specific (it reads usbmon/USBPcap pcapng, endpoints and control setup packets), but the inference part is not: it diffs payloads between labelled actions and looks for constant headers, counters, length fields, checksums and value fields. Network protocols would mostly need a different front end that feeds it TCP/UDP payloads. That isn’t built in today. For network protocols Netzob is worth a look, it has been doing that kind of inference for years. File formats are harder because you rarely get clean “I changed exactly one thing” pairs, but the same diffing trick works if you save the file twice with one setting changed.