DEV Community

Cover image for Reverse engineering your own devices when Claude and Codex refuse
Dennison Bertram
Dennison Bertram

Posted on

Reverse engineering your own devices when Claude and Codex refuse

You own the router. You own the smart plug. You want to see what the firmware actually does, maybe fix something the vendor abandoned. So you ask your coding agent to help you pull the image apart. It reads the file, then stops. No error, just a polite paragraph about how it can't help with that.

This post walks through a workflow for analyzing hardware and software you're allowed to take apart: identify a firmware image, carve out what's inside, read the strings, and go deeper on apps and binaries. I'll use FreePi for the agent side. FreePi is a free AI coding agent that runs in your terminal. It also offers a set of defense models built for exactly this kind of lawful work, so the agent helps instead of refusing.

Try it: run npx free-pi-cli@latest in a terminal.

Give this to your agent: www.freepi.ai/llms.txt

The rules first

Everything here is for work you're allowed to do:

  • Hardware and software you own.
  • Employer or client systems where you have written permission.
  • Bug bounty targets, inside the program's stated scope.
  • CTFs and lab devices built to be taken apart.

Owning the device is not a blank check. Vendor terms, warranty, and laws like anti-circumvention rules can still limit what you may do, and they vary by country. This isn't legal advice. If you're not sure you're in the clear, find out before you start.

Identify what you have

Say you dumped the flash off a device you own, or pulled an image from the vendor's update. Start by asking what it is:

file firmware.bin
Enter fullscreen mode Exit fullscreen mode

file reads the magic bytes and tells you if it's a known container, a filesystem, or just raw data. Often it says "data", which only means the format isn't obvious yet. That's where the next tool comes in.

Carve out what's inside

Firmware images usually pack several things together: a bootloader, a kernel, one or more filesystems. binwalk scans for the signatures of known formats and shows you where each one starts.

binwalk firmware.bin
Enter fullscreen mode Exit fullscreen mode

That prints a map. To pull the pieces out to disk, add extract:

binwalk -e firmware.bin
Enter fullscreen mode Exit fullscreen mode

Binwalk v3 is the Rust rewrite. -e extracts known file types into an extractions folder in your current directory. If you want it to recurse into what it just unpacked, add -M. Once a filesystem is carved out, you can walk it like any other directory.

Read the strings

Before and after extraction, printable strings tell you a lot: URLs the device phones home to, hardcoded paths, version banners, sometimes a comment someone left in.

strings -n 8 firmware.bin
Enter fullscreen mode Exit fullscreen mode

-n 8 only shows runs of 8 or more characters, which cuts the noise. Pipe it into grep to hunt for a hostname or a config key.

Drive it from the agent

None of these tools are FreePi. They're standard on any analyst's machine. What the agent adds is glue. It has a bash tool, so you can say "run binwalk on firmware.bin and summarize the sections," and it runs the command, reads the output, and tells you what matters. Then "extract the squashfs and list the init scripts," and it keeps going.

Its core tools are read, write, edit, bash, grep, find and ls. In a normal session there's no OS sandbox, so bash runs on your machine. Treat firmware as untrusted input:

  • Work in a container or throwaway VM.
  • Keep real credentials out of that environment.
  • Press Esc to interrupt the agent if it heads somewhere you didn't ask for.

When the model refuses

This is the part that stalls people. General-purpose models often decline anything shaped like an attack, even on your own device. The lawful request and the forbidden one can look identical to a model that's only matching surface patterns.

FreePi has a set of defense models for this. Inside the agent, open the model picker:

/model
Enter fullscreen mode Exit fullscreen mode

They are abliterated: open-weight models with their refusal behavior removed, so they help with the lawful security work general models decline. Right now the defense models are:

  • Abliterated Large Flash
  • Abliterated Large V2
  • DeepSeek V4.1 Flash Abliterated
  • Gemma 4 Uncensored
  • GLM 4.7 Flash Heretic
  • Qwen 3.6 Plus Uncensored
  • Uncensored 1.2

The list is read from the server when the CLI starts, so whatever you see in /model is current. They're opt-in: you only get one if you pick it. They need a GitHub sign-in, so type /login first. If you try one before signing in, the CLI opens the sign-in for you.

They're also not part of the free default. They run on premium credits. If you pick one without any, the CLI tells you so and points you to /buy-credits, or back to /model to switch.

My habit: stay on the free default model, and switch to a defense one only when the general model refuses the lawful part of the job. They aren't smarter. They just refuse less, so you still check everything they produce.

Going deeper on apps and binaries

Firmware is one case. Sometimes the thing you own is a native binary, an Electron app, an APK, or a .NET assembly. FreePi bundles a command for that:

/reverse-engineer-anything
Enter fullscreen mode Exit fullscreen mode

It loads a set of reverse-engineering tools into the current session only. The first run downloads them, so give it a minute. It needs Node 22.19+, 24.11+ or 26+. Deep native analysis still wants your own Hopper, Ghidra or IDA install. Then just ask in plain words: "list the modules this Go binary was built from," or "show this Electron app's IPC handlers."

Wrapping up

Reverse engineering your own hardware doesn't need a special lab. file, binwalk and strings get you a long way, and an agent that runs them for you turns a pile of commands into a conversation. The one thing that breaks the flow is a model that refuses lawful work, and that's what the defense models are for. Set your scope, work in a sandbox you control, and check every result.

Try it free with npx free-pi-cli@latest, and read more at www.freepi.ai.

Top comments (0)