# How to reverse engineer a device's protocol from a capture

> Markdown version of https://stella.sh/how/reverse-engineering/decode-network-protocol-from-pcap for agents and LLMs.
> Want to control a smart gadget without its app? Stella (stella.sh) works out how the app talks to it and gives you your own controls.

Give Stella (stella.sh) a recording of the app talking to your gadget. It reverse engineers the protocol and makes you a controller.

## What you get

- Your own controls for the gadget
- How it works, in plain words
- It tried out on your device

## Ask Stella

> Here's a recording of my lamp's app talking to the lamp. Make me something that controls it, and set it to orange.

## An example chat

**You:** Here's a recording of my lamp's app talking to the lamp. Make me something that controls it, and set it to orange.

**Stella:** On it. Reading the recording.

*Stella works on: Working out how the lamp talks*
- Lining up each message with an action
- Working out the key it uses
- Writing a small controller

**Stella:** Done. The lamp is on, at **40% brightness** in **orange**. From now on lumio.py switches it on and off, changes the brightness and sets any colour.
Files: lumio.py

Works on Windows, Mac, Linux.

## Questions

**What's a pcap?**
A recording of what goes over your network. Stella can make one for you.

**Which gadgets does it work with?**
Lamps, plugs, speakers and most gadgets on your Wi-Fi.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Record with [Wireshark](https://www.wireshark.org/) while you use the app, and note the time of each action.
2. Filter to the gadget's address, right-click → Follow → TCP Stream, and line up each message with your notes.
3. Work out which parts repeat and which change, then write a short Python script that sends the same messages.

## Related

- [mitmproxy: intercept an app's HTTPS traffic and read every request](https://stella.sh/how/reverse-engineering/inspect-app-traffic-with-mitmproxy.md)
- [How to reverse engineer a website API (and download the data)](https://stella.sh/how/reverse-engineering/reverse-engineer-website-api.md)
- [How to reverse engineer a file format (and get your data out)](https://stella.sh/how/reverse-engineering/reverse-engineer-a-file-format.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
