This commit is contained in:
zvecr 2022-03-29 19:25:16 +01:00
parent 05911e9908
commit 56c9f7b7ff
2 changed files with 3 additions and 3 deletions

View File

@ -56,11 +56,12 @@ def _xap_transaction(device, sub, route, ret_len, *args):
args_len += 2
args_data = args[0].to_bytes(2, byteorder='big')
padding = b"\x00" * (64 - 3 - args_len)
padding_len = 64 - 3 - args_len
padding = b"\x00" * padding_len
if args_data:
padding = args_data + padding
buffer = token + args_len.to_bytes(1, byteorder='big') + sub.to_bytes(1, byteorder='big') + route.to_bytes(1, byteorder='big') + padding
# prepend 0 on windows because reasons...
if 'windows' in platform().lower():
buffer = b"\x00" + buffer

View File

@ -121,4 +121,3 @@ def generate_header(output_file, keyboard):
lines.append('')
dump_lines(output_file, lines)