simple script to send notification on your phone on open door and more

This commit is contained in:
Maik Hofmann 2021-02-14 13:23:55 +01:00
parent e82d84d323
commit bd3a476683
17 changed files with 39 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
HCPBridge/.vscode HCPBridge/.vscode
Investigation/bussniffer/tools/opendooralert/opendooralert.py.bak Investigation/bussniffer/tools/opendooralert/opendooralert.py.bak
tools/opendooralert/opendooralert.py.bak

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

View File

@ -0,0 +1,23 @@
def calc_crc(data):
crc = 0xFFFF
for pos in data:
crc ^= pos
for i in range(8):
if ((crc & 1) != 0):
crc >>= 1
crc ^= 0xA001
else:
crc >>= 1
return crc
def checkLine(l):
data = bytearray.fromhex(l)
crc = calc_crc(data[:len(data)-2])
return str(crc == int.from_bytes(data[-2:],byteorder='little', signed=False))
#return "%04X %04X"%(crc,int.from_bytes(data[-2:],byteorder='little', signed=False))
with open("scan.txt") as f:
for line in f:
if len(line.strip()) > 0:
print(line.strip() + "\t" + checkLine(line.strip()))

View File

@ -0,0 +1,15 @@
f=open("dump2.bin","rb")
def DataToHex(data):
res = ""
for c in data:
res+=("%02X " % c)
return res
while True:
len = ord(f.read(1))
timestamp1 = f.read(2)
timestamp2 = f.read(2)
data = f.read(len)
print("%d:%d:%04X: %s" % (timestamp1[0]<<8|timestamp1[1],timestamp2[0]<<8|timestamp2[1], len,DataToHex(data)))
f.close()