Advertisement
CalcProgrammer1

Corsair K70 RGB USB protocol reverse engineering part 1

Oct 7th, 2014
3,308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. Corsair K70 RGB reverse engineering
  2. -----------------------------------
  3.  
  4. How To:
  5.  
  6. 1. On a Linux machine, set up VirtualBox and install Windows in it.
  7.  
  8. 2. Install Corsair Utility Engine software inside that Windows VM.
  9.  
  10. 3. Install Wireshark on Linux
  11.  
  12. 4. sudo modprobe usbmon
  13.  
  14. 5. Attach the Corsair K70 RGB keyboard USB device to the VM
  15.  
  16. 6. Let CUE detect the keyboard, then set a color profile for the LEDs
  17.  
  18. 7. Open Wireshark on the host OS as root, select the usbmon interface with the most data activity (as CUE continuously feeds the LED packets to the keyboard)
  19.  
  20. 8. Monitor for a short period then stop, you will notice that the packets repeat.
  21.  
  22. Observations:
  23.  
  24. - LED data appears to consume 5 USB frames
  25.  
  26. - Corsair Utility Engine continuously spams LED data to keyboard
  27.  
  28. - First half of USB data is USB protocol header, data from 0x0040 to end is actual LED protocol
  29.  
  30. - One "start" packet and four "data" packets
  31.  
  32. "Start" packet
  33. --------------
  34.  
  35. - Starts with 0x0727000 D8000000 with the rest of the data as 0x00
  36.  
  37. "Data" packets
  38. --------------
  39.  
  40. - Ordered 01, 02, 03, 04
  41.  
  42. - Starts with 0x7FXX3C00 where XX is 01, 02, or 03 depending on packet in sequence, except in the fourth packet, which is 0x7F042400.
  43.  
  44. - LED data seems to only go up to 7, i.e. 0x00 to 0x77.
  45.  
  46. - Certain byte positions are fixed as 0 or 7.
  47.  
  48. Packet 0x01
  49. -----------
  50.  
  51. Black:
  52.  
  53. 7F 01 3C 00 77 77 77 77 77 77 77 77 77 77 77 77
  54. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  55. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  56. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  57.  
  58. White:
  59.  
  60. 7F 01 3C 00 00 00 00 00 07 77 00 00 07 70 00 77
  61. 00 00 00 00 00 77 00 00 70 00 70 77 00 00 00 00
  62. 00 77 00 00 70 00 00 77 00 00 70 00 00 77 00 00
  63. 00 00 00 77 00 00 00 00 00 77 00 00 00 07 00 77
  64.  
  65. Packet 0x02
  66. -----------
  67.  
  68. Black:
  69.  
  70. 7F 02 3C 00 77 77 77 77 77 77 77 77 07 77 77 77
  71. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  72. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  73. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  74.  
  75. White:
  76.  
  77. 7F 02 3C 00 00 00 70 00 00 77 00 00 00 07 00 77
  78. 00 00 00 00 07 77 00 00 07 70 00 77 00 00 00 00
  79. 00 77 00 00 70 00 70 77 00 00 00 00 00 77 00 00
  80. 70 00 00 77 00 00 70 00 00 77 00 00 00 00 00 77
  81.  
  82. Packet 0x03
  83. -----------
  84.  
  85. Black:
  86.  
  87. 7F 03 3C 00 77 77 77 77 77 77 77 77 77 77 77 77
  88. 77 77 77 77 77 77 77 77 07 77 77 77 77 77 77 77
  89. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  90. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  91.  
  92. White:
  93.  
  94. 7F 03 3C 00 00 00 00 00 00 77 00 00 00 07 00 77
  95. 00 00 70 00 00 77 00 00 00 07 00 77 00 00 00 00
  96. 07 77 00 00 07 70 00 77 00 00 00 00 00 77 00 00
  97. 70 00 70 77 00 00 00 00 00 77 00 00 70 00 00 77
  98.  
  99. Packet 0x04
  100. -----------
  101.  
  102. Black:
  103.  
  104. 7F 04 24 00 77 77 77 77 77 77 77 77 77 77 77 77
  105. 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77
  106. 77 77 77 77 07 77 77 77 00 00 00 00 00 00 00 00
  107. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  108.  
  109. White:
  110.  
  111. 7F 04 24 00 00 00 70 00 00 77 00 00 00 00 00 77
  112. 00 00 00 00 00 77 00 00 00 07 00 77 00 00 70 00
  113. 00 77 00 00 00 07 00 77 00 00 00 00 00 00 00 00
  114. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement