Last active
February 8, 2016 09:56
-
-
Save sahuk/696ff4efa8cf53df4ad5 to your computer and use it in GitHub Desktop.
FSK dog collar packet dissection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from bitarray import bitarray | |
start = "101001110001000100010010" | |
ends = ["1000000000100100", | |
"0100000011100100", | |
"1100000001100100", | |
"0010000010000100", | |
"1010000000000100"] | |
for block in [bitarray(start + e, endian='little') for e in ends]: | |
xor = reduce(lambda x, y: x ^ y, | |
[ord(c) for c in block.tobytes()[:-1]]) | |
print xor, ord(block[-8:].tobytes()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 36 | |
39 39 | |
38 38 | |
33 33 | |
32 32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment