RE

    Reverse-Engineer BLE Device Protocols (Python + bleak)

    by Nate Freed

    1

    Map the Bluetooth Low Energy protocol of a gadget you own: capture it, diff it, decode it, check it on the device, and keep notes that say what is proven.

    $7

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    RE

    Reverse-Engineer BLE Device Protocols (Python + bleak)

    Example session with this skill installed

    I own a cheap BLE-only smart plug. I turned on the Android HCI snoop log and used the vendor app: tapped ON, OFF, ON, then set a 30-minute and a 90-minute timer. My stopwatch times are in actions.txt. I also recorded 30 s of idle traffic from my laptop with ble_listen.py (idle.jsonl). Work out the on/off and timer commands and start my protocol notes.

    • Read your context and instructions
    • Compiled the reverse-engineer ble device

    Session 2026-02-03, device plug-A
    Verified: 2 Inferred: 12 Retracted: 0 Open: 6
    Framing (inferred, frame_check: 47/47 packets, 0 contradictions):
    55 AA <seq> <cmd> <len> <payload> <xor8 of bytes 2..n-2>

    New this session

    • [INFERRED] relay: 55 AA <seq> 01 01 <00 off|01 on> <chk>, reply cmd 81 echoes state
    • [INFERRED] timer: 55 AA <seq> 02 02 <minutes u16le> <chk> (0x001e at 'timer 30', 0x005a at 'timer 90')
    • [INFERRED] report every 2 s: 55 AA 00 90 05 <state> <power u16le> <0.1 V u16le> <chk>
    • [VERIFIED] ffe9 = command write (no response), ffe4 = notify (discovery in phone log)
      Open: power unit (needs a known load), state after power-up without the app
      Next probe (needs your go-ahead; plug a lamp in and watch it):
    • probes/probe-01-relay.txt: ON with seq 0x20, then OFF with seq 0x21
      predict: lamp on/off; replies 55 aa 20 81 01 01 and 55 aa 21 81 01 00
      dry-run: 8 steps, no refusals
      Files: PROTOCOL-NOTES.md (notes_lint: clean), spec.json, captures/app-01.jsonl
    PROTOCOL-NOTES.md

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A step-by-step workflow and a toolkit for working out how your own BLE gadget talks: a smart bulb, fitness band, plug or sensor.

    What you get

    • Live helpers (bleak): scan, dump the GATT table, log every notification with timestamped markers, and run probe files (write, read, expect) that log all traffic.
    • Offline tools (standard library): convert an Android HCI snoop log of the vendor app into a capture. Group frames by message type and highlight the bytes that change between actions. Get hints for headers, length fields, 8-bit checksums and counters. Test a JSON frame spec against every packet you have captured.
    • Evidence discipline: a notes template and a linter. Every claim is tagged VERIFIED, INFERRED, UNKNOWN or RETRACTED, and every VERIFIED claim must cite a capture file and a date.
    • Safety: refuses writes to standard firmware-update services, lets you deny reset opcodes, dry-runs every probe and asks before sending it. Device addresses, serial numbers and revision strings are kept out of files, and a redact tool cleans files before you share them.

    For devices you own or are authorized to test.

    The live helpers (scan, GATT dump, listen, write) were tested only against a simulated device standing in for bleak, never against real hardware. They need bleak 0.19 or newer, and behaviour can vary by OS, adapter and bleak version. The checksum hints cover simple 8-bit sums and XORs only; CRCs, encryption and authenticated sessions are not detected or handled. The btsnoop converter reads datalink types 1001 and 1002 and plain ATT on L2CAP channel 4 (not Enhanced ATT), and was tested on synthetic files only. Handle-to-UUID mapping from a saved GATT table can be off by one on some platforms; the tool warns and has an offset flag. Typed markers need ble_listen run in an interactive terminal; otherwise use a timed marks file. The skill cannot see what a phone app sends unless you supply a phone HCI log. Getting that log on iOS needs Apple's own logging tools. Bluetooth Classic, firmware dumping or flashing, and over-the-air sniffing of other people's devices are out of scope. Hints are only candidates: deciding what a byte means still takes a person watching the device.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    Software
    Python 3.8+ (offline tools)bleak in a virtualenv (live capture)
    Optional
    Android phone with HCI snoop log

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    Files
    the
    user
    names
    and
    current
    working
    folder:
    capture
    logs
    (.jsonl/.txt)
    btsnoop
    gatt.json
    spec.json
    probe
    step
    files
    PROTOCOL-NOTES.md
    redacted
    copies
    asks
    for

    No network access. The live helpers use the computer's Bluetooth adapter through bleak. The first scan may trigger an OS Bluetooth permission prompt, which the user approves. They connect only to the device the user names, and they refuse writes to standard firmware-update (DFU/OTA) services and to any payloads the user denies. redact.py never overwrites its input. The offline tools use only the standard library and never touch Bluetooth.

    Listed7 days ago

    What's inside

    Creator

    N

    Nate Freed

    24 skills on Agensi

    Frequently Asked Questions

    Not for analysis. The offline tools work on capture logs and phone HCI snoop logs. You need the device, a Bluetooth adapter and bleak only to capture live or to run a verification probe.

    It refuses writes to the standard firmware-update services (and to anything named DFU or OTA). It can also refuse payloads you list, such as a factory-reset opcode. Every probe is dry-run and shown to you before it is sent. Even so, any write to an undocumented device carries some risk, so only test devices you own and could live without.

    No. It does not bypass pairing, bonding or encryption, and it detects only simple 8-bit checksums. It is meant for the many gadgets that send plain frames.

    The offline tools run anywhere Python 3.8+ runs. The live helpers use bleak, which supports macOS, Linux and Windows. They have been tested against a simulated device, not every OS and adapter combination.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.