hyderhusainarastu/hardware-mod-toolkit/firmware-image-analysis
Claude Code and agent skill by hyderhusainarastu/hardware-mod-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Statically analyse a firmware image or vendor update archive: partition table, image headers, signed or encrypted status, strings and log formats, subsystem map. Use when reverse engineering device behaviour from a firmware binary, or deciding what a custom build must reproduce.
Install
npx vskill@latest install hyderhusainarastu/hardware-mod-toolkit/firmware-image-analysisSKILL.md
The same SKILL.md was published earlier as hyderhusainarastu/hardware-mod-toolkit/firmware-image-analysis.
Firmware image analysis
Most of what a hardware mod needs to know — the display controller's real command set, the inter-MCU protocol's exact framing, the I2C addresses, the updater's acceptance rules, the boot-mode gestures — comes out of a vendor image, not out of probing the board. It is the cheap, zero-risk path, and it is the one people skip because it looks like it needs a disassembler and weeks of free time. It doesn't. Most of the value in this skill came from 20-instruction reads anchored on a log string, not from decompiling anything.
This skill assumes a <SOC_FAMILY> app-image format (ESP-IDF's is used as the worked example throughout — image magic 0xE9, segment table, appended SHA-256, esp_app_desc_t), but the method generalizes to any MCU with a documented image header and an OTA/bootloader split. Adjust the byte offsets, keep the discipline.
Use templates/recon-findings.md for the write-up shell and templates/verification-matrix.md to track which claims are image-level vs device-confirmed. Reference command lines live in references/tool-invocations.md; the document skeleton this skill produces is in references/analysis-record.md. Load ${CLAUDE_PLUGIN_ROOT}/templates/recon-findings.md from a plugin install, or templates/recon-findings.md from a repo checkout.
0. The one rule everything else follows
A string (or a call site) in an image proves that code exists in that image. It does not prove the code runs, that the peripheral is fitted, or how it is wired. Every claim that comes from strings or from a linked-symbol table is a claim about the binary. A claim about the physical <DEVICE> needs an extra, independent leg of evidence (a boot-log line, a photograph, a probe) — and when you promote a claim from image-level to device-level, name that extra leg explicitly in the write-up. When there is no extra leg, the claim stays at image level and says so.
Grade every claim CONFIRMED / STRONGLY INDICATED / POSSIBLE / UNKNOWN (see your project's evidence standard — usually in the top-level CLAUDE.md). A finding that later turns out wrong should be marked superseded, not silently edited away — the correction and what caused it are worth as much as the finding itself, because the next person doing this on a different device will hit the same trap.
1. Provenance first
Before reading a single byte of an image, record:
- Where it came from (vendor site, OTA capture, extracted from a device you already dumped),
retrieved date, and — if it's an update package — the vendor's own version string.
- Its SHA-256, and the SHA-256 of every member if it's a container (tar/zip).
- Whether an independent copy exists (a second download, a public mirror, the vendor's release
API) that lets you confirm the file you're analysing is really what the vendor ships, not something that was modified in transit or by a previous tool run.
- Where it lives on disk, and that it is gitignored. Vendor binaries, and every listing derived
from them (strings dumps, disassembly notes, extracted assets), go in a backups/vendor-firmware style directory that is excluded from version control and never redistributed. This applies even when the device is yours and the firmware update is public — a vendor's binary is not yours to republish, and a public toolkit repo must never carry one (see the publish-hygiene skill).
Write this as a table: file, size, origin, SHA-256, vendor version, retrieved date, stored path, "committed to git? NO — and it must stay that way."
2. The cheap passes, in order
Run these before anything that needs a disassembler. Each one is minutes of work and each one answers a specific question. Full command lines are in references/tool-invocations.md; the shape:
- `file` / size. Confirms you have what you think you have before spending time on it.
- Image header and segment map. For an ESP-IDF-style image: magic byte, chip ID, segment
count, entry point, flash size/freq/mode as declared in the header (see the caveat below), each segment's load address / length / file offset. Cross-check the vendor tool's output (esptool image_info or equivalent) against an independent byte-level parse in a 20-line script — when both agree exactly, you can trust the numbers; when they disagree, that disagreement is itself a finding.
- Signed? Encrypted? — see §2.1 below; this is usually the first question anyone asks and
the one most likely to be answered wrong by assumption instead of by counting bytes.
- Strings with a length filter.
strings -n 4(or-n 8for a cleaner ESP_LOG-format
sweep) on the whole image. Skim once for orientation; every serious use after that is a targeted grep, not a read-through.
- Log-format strings.
ESP_LOG-family binaries print"(%lu) %s: <fmt>"— grepping that
shape (or your target's equivalent log macro output) surfaces every subsystem's tag and every message the firmware can print, which is the fastest way to build the subsystem map in §4. These are worth diffing release-to-release: a short, explainable diff (§2.2) is often the entire behavioural changelog you need, without opening a disassembler.
- Symbol-ish anchors. Source-path strings (
./components/<name>/<file>.c), function-looking
names left in vtables or assert strings, and — for C++ builds — mangled or lightly-demangled class::method strings. These give you free function names for the disassembly-lite pass in §5.
2.1 Deciding signed / encrypted / anti-rollback from headers alone
- Signed? A signature block has its own magic byte and lives after the image's own appended
checksum/hash. Compute where the image's own content actually ends (segments + footer checksum + appended hash, exactly) and check whether the file is exactly that long. Zero trailing bytes = unsigned at image level. This says nothing about whether the bootloader requires a signature — that lives in eFuses / OTP, which you do not read as part of static analysis (that's a hardware-touching action; see hardware-in-the-loop-testing).
- Encrypted? A plaintext image parses: the app-descriptor struct decodes into sane version
strings and dates, and strings returns thousands of readable log lines. An encrypted image is high-entropy noise from just past the header on. There is no ambiguous middle case here — you will know within one command.
- Anti-rollback? Most IDF-style images carry a
secure_versionfield in the header or app
descriptor. secure_version = 0 in every release you have is itself the finding: no rollback protection, so an attacker (or your own recovery procedure) can install an older image freely.
- State plainly, every time: **"unsigned" is a claim about the payload. "The device boots unsigned
payloads" is a claim about the eFuse-configured boot chain. Never let the first stand in for the second.**
2.2 Diffing releases is a first-class analysis technique
If you can get more than one version of the vendor firmware (an official release archive, a release API, old OTA captures), diff their string tables:
A short, explainable diff (a dozen added lines, a handful removed) across a version bump that a release-notes entry describes is strong corroboration that you're looking at the right build, and it tells you exactly which subsystem the vendor touched without reading a single instruction. It also protects you from the single most expensive mistake in this whole discipline:
**Verify you are analysing the version the device actually runs, before writing 1000 linesof analysis about a different one.** A device's own boot log (build hash, compile timestamp, IDFversion, a distinguishing log line only present in some releases) is the cheapest possible checkand it is worth doing before the deep-dive, not after. Getting this wrong doesn't just wastethe analysis — every offset in it becomes a trap for whoever replays it against the real device.
3. Partition table
For any SoC that boots through a partition table (ESP-IDF's is the running example: a 32-byte entry per partition — magic, type, subtype, offset, size, 16-byte label, flags — terminated by an MD5 entry), decode it two ways and expect them to agree:
- With the vendor/toolchain's own tool if one ships (
esptool.py <table>.bin --infoor
equivalent partition-table dump).
- With your own ~20-line decoder reading the raw bytes. When both agree, trust the table. When
they disagree, that's the finding — write it up before doing anything else with the table.
Two traps specific to vendor update archives (as opposed to a full flash dump):
- **An application-slot payload (an OTA
.binplus assets) usually contains NO partition table,
bootloader, otadata, or filesystem image at all. Scan for the partition-magic bytes anyway — false positives inside compiled code are common and none of them will decode as a valid, MD5-terminated table. State this as a confirmed *absence*, and then state the consequence plainly: the update package is not a recovery image.** It cannot restore a device whose bootloader or partition table is damaged, no matter how complete it looks.
- The regions described by NO partition-table entry are exactly where the traps live. A
partition table only ever describes what a normal boot needs; the space it leaves silent (an unlabelled gap, a factory-reserved region, whatever sits before the first entry) is worth a one-line note even when you have nothing to say about it yet — silence there is not "nothing to find," it's "not yet looked at."
Produce a carve table — offset, size, type/subtype, label, and (for app slots) which image currently occupies it if you know — as the artifact this section exists to produce. Everything in §6 ("implications for the mod") cites offsets from this table.
4. Subsystem mapping
Build a responsibility matrix before reading any single function in detail. Columns: subsystem (display, inter-MCU link, USB, radio/BT, storage/filesystem, updater, power, boot-mode handling); rows: which image/binary (if the device has more than one MCU) owns it, and the evidence.
The technique that makes this cheap and reliable is a mutually exclusive presence/absence argument, which is much stronger than a one-sided "I found a string, so it must be here":
If subsystem A's every keyword lands in image 1 and never in image 2, and subsystem B is the exact mirror image, that's a CONFIRMED architectural split — not just "feature X exists somewhere." Two things make this reliable rather than a false negative:
- Match case-sensitively unless you have a specific reason not to, and re-run once
case-insensitively as a sanity check. A case-insensitive sweep can pull in an unrelated hit from a different stack (e.g. a Bluetooth host symbol matching a keyword you meant for USB host) — when that happens, the conclusion usually survives, but the reproduction command you write down needs to match what you actually ran, not what you intended to run.
- Log tags are a free index. Every
ESP_LOG-style tag (TAG_APP,SOMETHING_MGR, …) found in
§2's log-format sweep names a subsystem and can be grep-anchored to enumerate every message that subsystem can produce — which is often a complete state-machine map with zero disassembly.
5. Disassembly-lite
You rarely need full decompilation. The pattern that answers most questions:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/firmware-image-analysis/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hyderhusainarastu/hardware-mod-toolkit/firmware-image-analysis)