diff options
author | jaseg <git@jaseg.net> | 2018-11-13 22:43:00 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2018-11-13 22:43:00 +0900 |
commit | 370301e06da15aada3772461d9f96d50d87475ca (patch) | |
tree | 2489ef425500100500326a3bdef0105d74ce5e78 /hexnoise.py | |
parent | e16515bb643b9329318809ecc134f74c22a86382 (diff) | |
download | secure-hid-370301e06da15aada3772461d9f96d50d87475ca.tar.gz secure-hid-370301e06da15aada3772461d9f96d50d87475ca.tar.bz2 secure-hid-370301e06da15aada3772461d9f96d50d87475ca.zip |
Add tracing
Diffstat (limited to 'hexnoise.py')
-rwxr-xr-x | hexnoise.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hexnoise.py b/hexnoise.py index 8a8dae5..cfbe9df 100755 --- a/hexnoise.py +++ b/hexnoise.py @@ -277,7 +277,7 @@ class NoiseEngine: with suppress(NoiseInvalidMessage): yield setter - proto.noise_protocol.cipher_state_decrypt.n = nold + self.proto.noise_protocol.cipher_state_decrypt.n = nold def pairing_messages(self): user_input = '' @@ -309,12 +309,11 @@ class NoiseEngine: if msg_type is ReportType.KEYBOARD: modbyte, _reserved, *keycodes = report - print(' payload:', payload) - print(' modifier:', list(KeyMapper.map_modifiers(modbyte))) - print(' regular:', list(KeyMapper.map_regulars(keycodes))) + import binascii keys = { *KeyMapper.map_modifiers(modbyte), *KeyMapper.map_regulars(keycodes) } if self.debug: print('Emitting:', keys) + print('payload:', binascii.hexlify(payload), 'emitting:', keys) for key in keys - old_kcs: ui.emit(key, 1, syn=False) |