ghidra
Skill0 starsChanged 3 months agoMITView on GitHub
Use when analyzing raw firmware images (ARM/Thumb embedded), dumped flash, or binaries without symbols - importing at a custom base address, seeding function discovery, and dumping decompiled output + xrefs for offline study via Ghidra headless.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- mitsuhiko/agent-commandstheir own version, first seen Oct 8, 2026
- mitsuhiko/agent-stufftheir own version, first seen Oct 8, 2026
- CodeWithBehnam/cc-docstheir own version, first seen Mar 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- mitsuhiko/agent-commands★ 3.2ksame name
- mitsuhiko/agent-stuff★ 3.2ksame name
- CodeWithBehnam/cc-docs★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository110 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/project-bootstrap/templates/agents.mdAGENTS.md
- a11y-auditSkill
- agentic-ragSkill
- agent-reachSkill
- ai3d-genSkill
- ai-coding-dictionarySkill
- ai-toolsSkill
- animation-directionSkill
- api-specSkill
- architecture-diagramsSkill
- architectureSkill
- ascii-artSkill
- ask-bundleSkill
- binary-triageSkill
- bragSkill
- brag-slimSkill
- career-opsSkill
- code-reviewSkill
- computer-useSkill
- context7Skill
- context-hygieneSkill
- creative-engineeringSkill
- cu-realtimeSkill
- data-analystSkill
- databaseSkill
- dead-wireSkill
- debuggingSkill
- deploySkill
- devin-configSkill
- dispatching-parallel-agentsSkill
- dmaSkill
- dockerSkill
- drift-reportSkill
- e2e-testingSkill
- edge-casesSkill
- executionSkill
- fact-checkSkill
- finishing-a-development-branchSkill
- firmware-probeSkill
- frontend-designSkill
- gatesSkill
- ghSkill
- github-actionsSkill
- git-workflowsSkill
- grillingSkill
- handoffSkill
- humanizerSkill
- hyperframesSkill
- i18nSkill
- image-forensicsSkill
- impeccableSkill
- implement-layaSkill
- intakeSkill
- jiraSkill
- knowledge-modelingSkill
- laya-orchestratorSkill
- learn-modeSkill
- mcp-governanceSkill
- media-toolsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Import with explicit base address (e.g.
- Very specific: line 32
RAM matters: Create the RAM memory block (e.g.
- Very specific: line 46
Add RAM block via getMemory().createInitializedBlock("ram", toAddr(0x20000000), size, (byte)0, monitor, false) (or …
- Very specific: line 47
Read seed addresses from seeds.txt (capstone-generated BL targets), disassemble(addr) each.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ghidra headless firmware RE
Validated on Ghidra 12.1.4 + OpenJDK 25, Windows. Target: nRF52810 Cortex-M4 Thumb app slice (Minew ESL tag), but applies to any raw bin.
When
- Raw firmware
.bin(no ELF headers, no symbols) needs decompilation. - Need repeatable dumps of decompiled functions + xrefs to answer "who calls X", "what reads offset Y in ctx".
- Capstone-level disasm is not enough (literal-pool indirection, computed refs, argument tracking).
Install / locate
- Ghidra has no winget package. Download the release zip from GitHub
NationalSecurityAgency/ghidra, extract somewhere stable, e.g.tools/ghidra. - Needs JDK 17+ on PATH.
- Headless binary:
<ghidra>/support/analyzeHeadless.bat(Windows) /analyzeHeadless(Linux).
Hard-won facts (do not relearn)
- Ghidra 12 has no Jython.
.pypost-scripts fail with "Ghidra was not started with PyGhidra". Write analysis scripts in Java (GhidraScriptsubclass) - they run directly. - Raw import needs manual context. A bare app-slice
.binhas no vector table, so auto-analysis finds ~zero functions. You must:- Import with explicit base address (e.g. app at
0x19000after bootloader). - Set Thumb mode:
setRegisterValue/ context registerTMode=1on the whole image range before disassembly. - Seed known function addresses, or auto-analysis stays blind.
- Import with explicit base address (e.g. app at
- Linear sweep
disassemble()per halfword is too slow (flow analysis per call). Instead: generate a seed list from Capstone BL/B.W targets (one pass in Python over the bin) plus known entry points, then let Ghidra'sdisassembleexpand by control flow. ~213 seeds -> full coverage in seconds. - RAM matters. Create the RAM memory block (e.g.
0x20000000-0x2003ffff) or the decompiler cannot resolveldrinto ctx structures. CatchMemoryConflictException- the block may already exist. - Match the binary to the dump. Decompiled addresses are meaningless across firmware versions. Record which
.binproduced whichgh_dump.txt; re-scan constants (e.g.movw #0xca01) in the SAME file. - Ghidra misreads
ldr/strliteral-pool pairs as arrays.DAT_0001f334looked like a 10-u32 table but was{fn_ptr, param}pairs - verify suspicious "tables" by dumping raw bytes and checking for Thumb function pointers (odd addresses into code). analyzeHeadless <projdir> <projname> -import <bin> -processor <lang> -cspec <c> -postScript <script> [args] -scriptPath <dir>- processor for Cortex-M4 Thumb LE:ARM:LE:32:v7(v8 for M33+).
Workflow that worked
support\analyzeHeadless.bat ghproj esl -import fw.bin ^
-processor ARM:LE:32:v7 -postScript GhDump.java -scriptPath . -deleteProjectScript skeleton (Java):
setRegisterValueTMode=1 over[imgStart, imgStart+len).- Add RAM block via
getMemory().createInitializedBlock("ram", toAddr(0x20000000), size, (byte)0, monitor, false)(orcreateUninitializedBlock). - Read seed addresses from
seeds.txt(capstone-generated BL targets),disassemble(addr)each. - For each target function:
getFunctionAt,DecompInterface.openProgram,decompileFunction(fn, 60, monitor), printgetDecompiledFunction().getC(). - Print xrefs:
getReferencesTo(addr)/getReferencesFrom. - Print
cmp/movwsites matching interesting immediates.
Capstone seed generator (python):
from capstone import *
data = open('fw.bin','rb').read(); base = 0x19000
md = Cs(CS_ARCH_ARM, CS_MODE_THUMB | CS_MODE_LITTLE_ENDIAN)
seeds = set()
for off in range(0, len(data)-4, 2):
for i in md.disasm(data[off:off+4], base+off, 2):
if i.mnemonic in ('bl','blx','b','b.w') and i.op_str.startswith('#0x'):
t = int(i.op_str[1:],16)
if base <= t < base+len(data): seeds.add(t)
open('seeds.txt','w').write('\n'.join(hex(s) for s in sorted(seeds)))Analysis recipes that paid off
- Find a message consumer: producers
FUN_x(msg_id, sub, buf, len)are easy; consumers live in other tasks. Grep disasm forcmp rX, #<msgid>clusters - the real dispatcher compares several IDs in one function. Do not trust the firstmovs r0,#id(that is a producer). - Follow ctx offsets, not names: pick a struct offset (e.g.
ctx+0x118), grep all disasm touching it - that is how you find readers/writers when there are no xrefs (literal pools). - Odd-value table entries:
0x196f5in a "param table" = Thumb func ptr (low bit). Dump code there; tinymovs r0,#N; bx lrgetters reveal the slot is a callback column, not data. - Distinguish "committed" vs "rendered" on hardware: protocol ack != visual effect. Correlate each hypothesis test with a physical observation (flash, LED, pixels) before recording conclusions.
Outputs to keep
gh_dump.txt: decompiled functions + xrefs + cmp-site index, checked next to the.binit came from.seeds.txt: reproducible function seed list.- Project notes doc: dispatcher table, msg-type map, ctx offsets, hardware-confirmed behaviors vs hypotheses. Date each section; mark superseded interpretations instead of deleting them.
Cascade
binary-triage: cheap static triage first; Ghidra is the escalation.re-binary: managed RE via rea-ops when its engine covers the artifact.firmware-probe: extraction (binwalk/EMBA) before RE.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

