-
Notifications
You must be signed in to change notification settings - Fork 8
/
payload.py
35 lines (26 loc) · 3.1 KB
/
payload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import sys
import traceback
# payload color was ff5200
# preamble to set colors
REPORT_LEN = 642
SET_COLORS = [0x3a, 0x69]
COLOR_PAYLOAD = [0x04, 0xff, 0x52, 0x00, 0x05, 0xff, 0x52, 0x00, 0x06, 0xff, 0x52, 0x00, 0x07, 0xff, 0x52, 0x00, 0x08, 0xff, 0x52, 0x00, 0x09, 0xff, 0x52, 0x00, 0x0a, 0xff, 0x52, 0x00, 0x0b, 0xff, 0x52, 0x00, 0x0c, 0xff, 0x52, 0x00, 0x0d, 0xff, 0x52, 0x00, 0x0e, 0xff, 0x52, 0x00, 0x0f, 0xff, 0x52, 0x00, 0x10, 0xff, 0x52, 0x00, 0x11, 0xff, 0x52, 0x00, 0x12, 0xff, 0x52, 0x00, 0x13, 0xff, 0x52, 0x00, 0x14, 0xff, 0x52, 0x00, 0x15, 0xff, 0x52, 0x00, 0x16, 0xff, 0x52, 0x00, 0x17, 0xff, 0x52, 0x00, 0x18, 0xff, 0x52, 0x00, 0x19, 0xff, 0x52, 0x00, 0x1a, 0xff, 0x52, 0x00, 0x1b, 0xff, 0x52, 0x00, 0x1c, 0xff, 0x52, 0x00, 0x1d, 0xff, 0x52, 0x00, 0x1e, 0xff, 0x52, 0x00, 0x1f, 0xff, 0x52, 0x00, 0x20, 0xff, 0x52, 0x00, 0x21, 0xff, 0x52, 0x00, 0x22, 0xff, 0x52, 0x00, 0x23, 0xff, 0x52, 0x00, 0x24, 0xff, 0x52, 0x00, 0x25, 0xff, 0x52, 0x00, 0x26, 0xff, 0x52, 0x00, 0x27, 0xff, 0x52, 0x00, 0x29, 0xff, 0x52, 0x00, 0x2a, 0xff, 0x52, 0x00, 0x2b, 0xff, 0x52, 0x00, 0x2d, 0xff, 0x52, 0x00, 0x2e, 0xff, 0x52, 0x00, 0x2f, 0xff, 0x52, 0x00, 0x30, 0xff, 0x52, 0x00, 0x33, 0xff, 0x52, 0x00, 0x34, 0xff, 0x52, 0x00, 0x35, 0xff, 0x52, 0x00, 0x36, 0xff, 0x52, 0x00, 0x37, 0xff, 0x52, 0x00, 0x38, 0xff, 0x52, 0x00, 0x39, 0xff, 0x52, 0x00, 0x3a, 0xff, 0x52, 0x00, 0x3b, 0xff, 0x52, 0x00, 0x3c, 0xff, 0x52, 0x00, 0x3d, 0xff, 0x52, 0x00, 0x3e, 0xff, 0x52, 0x00, 0x3f, 0xff, 0x52, 0x00, 0x40, 0xff, 0x52, 0x00, 0x41, 0xff, 0x52, 0x00, 0x42, 0xff, 0x52, 0x00, 0x43, 0xff, 0x52, 0x00, 0x44, 0xff, 0x52, 0x00, 0x45, 0xff, 0x52, 0x00, 0x46, 0xff, 0x52, 0x00, 0x47, 0xff, 0x52, 0x00, 0x48, 0xff, 0x52, 0x00, 0x49, 0xff, 0x52, 0x00, 0x4a, 0xff, 0x52, 0x00, 0x4b, 0xff, 0x52, 0x00, 0x4c, 0xff, 0x52, 0x00, 0x4d, 0xff, 0x52, 0x00, 0x4e, 0xff, 0x52, 0x00, 0x4f, 0xff, 0x52, 0x00, 0x50, 0xff, 0x52, 0x00, 0x51, 0xff, 0x52, 0x00, 0x52, 0xff, 0x52, 0x00, 0x53, 0xff, 0x52, 0x00, 0x54, 0xff, 0x52, 0x00, 0x55, 0xff, 0x52, 0x00, 0x56, 0xff, 0x52, 0x00, 0x57, 0xff, 0x52, 0x00, 0x58, 0xff, 0x52, 0x00, 0x59, 0xff, 0x52, 0x00, 0x5a, 0xff, 0x52, 0x00, 0x5b, 0xff, 0x52, 0x00, 0x5c, 0xff, 0x52, 0x00, 0x5d, 0xff, 0x52, 0x00, 0x5e, 0xff, 0x52, 0x00, 0x5f, 0xff, 0x52, 0x00, 0x60, 0xff, 0x52, 0x00, 0x61, 0xff, 0x52, 0x00, 0x62, 0xff, 0x52, 0x00, 0x63, 0xff, 0x52, 0x00, 0xe0, 0xff, 0x52, 0x00, 0xe1, 0xff, 0x52, 0x00, 0xe2, 0xff, 0x52, 0x00, 0xe3, 0xff, 0x52, 0x00, 0xe4, 0xff, 0x52, 0x00, 0xe5, 0xff, 0x52, 0x00, 0xe6, 0xff, 0x52, 0x00, 0xe7, 0xff, 0x52, 0x00, 0xf0, 0xff, 0x52, 0x00, 0x2c, 0xff, 0x52, 0x00, 0x28, 0xff, 0x52, 0x00, 0x32, 0xff, 0x52, 0x00, 0x64, 0xff, 0x52, 0x00]
COLOR_CODE = [0xff, 0x52, 0x00]
KEY_ADDR = []
buf = ""
for idx, val in enumerate(COLOR_PAYLOAD):
buf += str(val)
if idx % 4 == 0:
KEY_ADDR.append(val)
buf += " "
if idx % 4 == 3:
print(buf)
buf = ""
print("KEY_ADDR = [%s]" % ", ".join(map(str, [hex(x) for x in KEY_ADDR])))
report = SET_COLORS + COLOR_PAYLOAD
if len(report) < REPORT_LEN:
report = report + [0x00] * (REPORT_LEN - len(report))
# padding
print("report len", len(report))
print(report)