Skip to content

Instantly share code, notes, and snippets.

@hoehermann
Created October 17, 2025 22:40
Show Gist options
  • Save hoehermann/fa48f32e3dc2f576cdb2b4d162b27f1e to your computer and use it in GitHub Desktop.
Save hoehermann/fa48f32e3dc2f576cdb2b4d162b27f1e to your computer and use it in GitHub Desktop.

Revisions

  1. hoehermann created this gist Oct 17, 2025.
    38 changes: 38 additions & 0 deletions cyberJack.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    # ChatGPT wrote this

    import usb.core
    import usb.util
    import argparse

    class CyberJack:
    def __init__(self):
    self.dev = usb.core.find(idVendor=0x0c4b, idProduct=0x0501)
    if self.dev is None:
    raise ValueError("REINER SCT cyberJack comfort not found")
    cfg = self.dev.get_active_configuration()
    intf = usb.util.find_descriptor(cfg, bInterfaceNumber=0)
    if self.dev.is_kernel_driver_active(intf.bInterfaceNumber):
    raise RuntimeError("Device is bound to a Kernel driver.")
    usb.util.claim_interface(self.dev, intf.bInterfaceNumber)
    self.ep_out = usb.util.find_descriptor(intf, bEndpointAddress=0x02)
    self.ep_in = usb.util.find_descriptor(intf, bEndpointAddress=0x81)
    def set_brightness(self, value: int):
    if not 0 <= value <= 255:
    raise ValueError("value must be in 0..255")
    prefix = "6b07" # no idea what this is about
    unknown1 = "00000000"
    sequence_counter = "11" # the device's reply will contain this, but I do not check or care; is one byte and rolls over
    unknown2 = "00000001000001" # the lowest byte could be the upper byte of the key
    key = "3300" # the lower byte could actually be the upper byte of the value
    value_hex = f"{value:02x}"
    data = prefix + unknown1 + sequence_counter + unknown2 + key + value_hex
    bytes_sent = self.dev.write(self.ep_out.bEndpointAddress, bytes.fromhex(data), timeout=100)
    resp = self.dev.read(self.ep_in.bEndpointAddress, 20, timeout=2000)
    return resp

    if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Set CyberJack brightness")
    parser.add_argument("--brightness", type=int, required=True, help="brightness 0-255")
    args = parser.parse_args()
    cyberjack = CyberJack()
    resp = cyberjack.set_brightness(args.brightness)