Skip to content

Instantly share code, notes, and snippets.

@jonasmalacofilho
Forked from TheUbuntuGuy/fuckuanova.py
Created July 25, 2019 12:19
Show Gist options
  • Save jonasmalacofilho/9006f15d76970ae2c0ffe4f65cda9451 to your computer and use it in GitHub Desktop.
Save jonasmalacofilho/9006f15d76970ae2c0ffe4f65cda9451 to your computer and use it in GitHub Desktop.
Decode Anova Precision Cooker WiFi Packets
#!/usr/bin/python3
import math
f = open("rawdump.txt", "r")
for l in f.readlines():
p = 0
chars = []
chksum = 0
for i in range(0, len(l), 2):
line = l[i:i+2]
if line != "\n":
byte = int(line, 16)
p += 1
if p == 2:
print("Len: {}".format(byte))
if p == math.floor((len(l)/2) - 1):
chksum = chksum & ((2**8) - 1)
if byte == chksum:
print("Chksum: OK")
else:
print("Chksum: FAIL. Read: {} != calc'd: {}".format(line, chksum))
if p >= 3 and p < (len(l)/2) - 2:
chksum += byte
n = (p - 2) % 7
byte = byte >> (n) | ((byte & (2**n)-1) << 8-n)
chars.append(chr(byte))
print("{}\n".format(''.join(chars)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment