diff --git a/.gitignore b/.gitignore index 8a9584c..68bc17f 100644 --- a/.gitignore +++ b/.gitignore @@ -158,5 +158,3 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ - - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4edd9bf..5d16910 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,7 +62,7 @@ repos: rev: 23.3.0 hooks: - id: black - language_version: python3.10 + language_version: python3.11 - repo: https://github.com/PyCQA/bandit rev: 1.7.5 hooks: diff --git a/blatted/poc.py b/blatted/poc.py index 6aedcb6..02b2a46 100644 --- a/blatted/poc.py +++ b/blatted/poc.py @@ -1,15 +1,19 @@ import asyncio -from bleak import BleakClient, BleakGATTCharacteristic import bleak.exc - +from bleak import BleakClient, BleakGATTCharacteristic from hexdump import hexdump from icecream import ic address = "C8:05:E1:A1:93:00" - -services = {"read": [], "notify": [], "write": [], "write-without-response": [], "indicate": []} +services = { + "read": [], + "notify": [], + "write": [], + "write-without-response": [], + "indicate": [], +} async def notification_handler(sender: BleakGATTCharacteristic, data: bytearray): @@ -41,7 +45,7 @@ async def main(address): services[prop].append(char) ic(char.handle) ic("—" * 79) - line ="[+] {}".format("="*70) + line = "[+] {}".format("=" * 70) ic(line) for service in services["notify"]: @@ -49,10 +53,6 @@ async def main(address): for service in services["notify"]: try: - # await client.start_notify("00002ad2-0000-1000-8000-00805f9b34fb", notification_handler) - # await client.start_notify("00002ada-0000-1000-8000-00805f9b34fb", notification_handler) - # await client.start_notify("00002ad3-0000-1000-8000-00805f9b34fb", notification_handler) - ic(f"[+] start_notify {service}") await client.start_notify(service.uuid, notification_handler) ic(f"[+] handler registered for {service.uuid}")