[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ADKYF3A7RXX9FTZ23K5Q02":3,"skill-same:01M7ADKYF3A7RXX9FTZ23K5Q02":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":37,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M7ADKYF3A7RXX9FTZ23K5Q02","ghidra",null,"Use when analyzing raw firmware images (ARM\u002FThumb 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.","Leostruka\u002Fdevin-bundle","Leostruka","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F81370685?v=4","01M7AD8MAK63VDNAWRDRRRW04N","leandro ostruka","01M7AD8MBS65YDS1KMMV7YPM07",0,"MIT","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fghidra\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ghidra\ndescription: Use when analyzing raw firmware images (ARM\u002FThumb 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.\ntriggers: [user, model]\nallowed-tools: [read, exec, write, edit]\n---\n\n# Ghidra headless firmware RE\n\nValidated on Ghidra 12.1.4 + OpenJDK 25, Windows. Target: nRF52810 Cortex-M4 Thumb app slice (Minew ESL tag), but applies to any raw bin.\n\n## When\n\n- Raw firmware `.bin` (no ELF headers, no symbols) needs decompilation.\n- Need repeatable dumps of decompiled functions + xrefs to answer \"who calls X\", \"what reads offset Y in ctx\".\n- Capstone-level disasm is not enough (literal-pool indirection, computed refs, argument tracking).\n\n## Install \u002F locate\n\n- Ghidra has no winget package. Download the release zip from GitHub `NationalSecurityAgency\u002Fghidra`, extract somewhere stable, e.g. `tools\u002Fghidra`.\n- Needs JDK 17+ on PATH.\n- Headless binary: `\u003Cghidra>\u002Fsupport\u002FanalyzeHeadless.bat` (Windows) \u002F `analyzeHeadless` (Linux).\n\n## Hard-won facts (do not relearn)\n\n1. **Ghidra 12 has no Jython.** `.py` post-scripts fail with \"Ghidra was not started with PyGhidra\". Write analysis scripts in **Java** (`GhidraScript` subclass) - they run directly.\n2. **Raw import needs manual context.** A bare app-slice `.bin` has no vector table, so auto-analysis finds ~zero functions. You must:\n   - Import with explicit base address (e.g. app at `0x19000` after bootloader).\n   - Set Thumb mode: `setRegisterValue` \u002F context register `TMode=1` on the whole image range before disassembly.\n   - Seed known function addresses, or auto-analysis stays blind.\n3. **Linear sweep `disassemble()` per halfword is too slow** (flow analysis per call). Instead: generate a seed list from **Capstone BL\u002FB.W targets** (one pass in Python over the bin) plus known entry points, then let Ghidra's `disassemble` expand by control flow. ~213 seeds -> full coverage in seconds.\n4. **RAM matters.** Create the RAM memory block (e.g. `0x20000000`-`0x2003ffff`) or the decompiler cannot resolve `ldr` into ctx structures. Catch `MemoryConflictException` - the block may already exist.\n5. **Match the binary to the dump.** Decompiled addresses are meaningless across firmware versions. Record which `.bin` produced which `gh_dump.txt`; re-scan constants (e.g. `movw #0xca01`) in the SAME file.\n6. **Ghidra misreads `ldr\u002Fstr` literal-pool pairs as arrays.** `DAT_0001f334` looked 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).\n7. `analyzeHeadless \u003Cprojdir> \u003Cprojname> -import \u003Cbin> -processor \u003Clang> -cspec \u003Cc> -postScript \u003Cscript> [args] -scriptPath \u003Cdir>` - processor for Cortex-M4 Thumb LE: `ARM:LE:32:v7` (v8 for M33+).\n\n## Workflow that worked\n\n```bat\nsupport\\analyzeHeadless.bat ghproj esl -import fw.bin ^\n  -processor ARM:LE:32:v7 -postScript GhDump.java -scriptPath . -deleteProject\n```\n\nScript skeleton (Java):\n- `setRegisterValue` TMode=1 over `[imgStart, imgStart+len)`.\n- Add RAM block via `getMemory().createInitializedBlock(\"ram\", toAddr(0x20000000), size, (byte)0, monitor, false)` (or `createUninitializedBlock`).\n- Read seed addresses from `seeds.txt` (capstone-generated BL targets), `disassemble(addr)` each.\n- For each target function: `getFunctionAt`, `DecompInterface.openProgram`, `decompileFunction(fn, 60, monitor)`, print `getDecompiledFunction().getC()`.\n- Print xrefs: `getReferencesTo(addr)` \u002F `getReferencesFrom`.\n- Print `cmp`\u002F`movw` sites matching interesting immediates.\n\nCapstone seed generator (python):\n\n```python\nfrom capstone import *\ndata = open('fw.bin','rb').read(); base = 0x19000\nmd = Cs(CS_ARCH_ARM, CS_MODE_THUMB | CS_MODE_LITTLE_ENDIAN)\nseeds = set()\nfor off in range(0, len(data)-4, 2):\n    for i in md.disasm(data[off:off+4], base+off, 2):\n        if i.mnemonic in ('bl','blx','b','b.w') and i.op_str.startswith('#0x'):\n            t = int(i.op_str[1:],16)\n            if base \u003C= t \u003C base+len(data): seeds.add(t)\nopen('seeds.txt','w').write('\\n'.join(hex(s) for s in sorted(seeds)))\n```\n\n## Analysis recipes that paid off\n\n- **Find a message consumer**: producers `FUN_x(msg_id, sub, buf, len)` are easy; consumers live in other tasks. Grep disasm for `cmp rX, #\u003Cmsgid>` clusters - the real dispatcher compares several IDs in one function. Do not trust the first `movs r0,#id` (that is a producer).\n- **Follow ctx offsets, not names**: pick a struct offset (e.g. `ctx+0x118`), grep all disasm touching it - that is how you find readers\u002Fwriters when there are no xrefs (literal pools).\n- **Odd-value table entries**: `0x196f5` in a \"param table\" = Thumb func ptr (low bit). Dump code there; tiny `movs r0,#N; bx lr` getters reveal the slot is a callback column, not data.\n- **Distinguish \"committed\" vs \"rendered\" on hardware**: protocol ack != visual effect. Correlate each hypothesis test with a physical observation (flash, LED, pixels) before recording conclusions.\n\n## Outputs to keep\n\n- `gh_dump.txt`: decompiled functions + xrefs + cmp-site index, checked next to the `.bin` it came from.\n- `seeds.txt`: reproducible function seed list.\n- 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.\n\n## Cascade\n\n- `binary-triage`: cheap static triage first; Ghidra is the escalation.\n- `re-binary`: managed RE via rea-ops when its engine covers the artifact.\n- `firmware-probe`: extraction (binwalk\u002FEMBA) before RE.\n","# Ghidra headless firmware RE\n\nValidated on Ghidra 12.1.4 + OpenJDK 25, Windows. Target: nRF52810 Cortex-M4 Thumb app slice (Minew ESL tag), but applies to any raw bin.\n\n## When\n\n- Raw firmware `.bin` (no ELF headers, no symbols) needs decompilation.\n- Need repeatable dumps of decompiled functions + xrefs to answer \"who calls X\", \"what reads offset Y in ctx\".\n- Capstone-level disasm is not enough (literal-pool indirection, computed refs, argument tracking).\n\n## Install \u002F locate\n\n- Ghidra has no winget package. Download the release zip from GitHub `NationalSecurityAgency\u002Fghidra`, extract somewhere stable, e.g. `tools\u002Fghidra`.\n- Needs JDK 17+ on PATH.\n- Headless binary: `\u003Cghidra>\u002Fsupport\u002FanalyzeHeadless.bat` (Windows) \u002F `analyzeHeadless` (Linux).\n\n## Hard-won facts (do not relearn)\n\n1. **Ghidra 12 has no Jython.** `.py` post-scripts fail with \"Ghidra was not started with PyGhidra\". Write analysis scripts in **Java** (`GhidraScript` subclass) - they run directly.\n2. **Raw import needs manual context.** A bare app-slice `.bin` has no vector table, so auto-analysis finds ~zero functions. You must:\n   - Import with explicit base address (e.g. app at `0x19000` after bootloader).\n   - Set Thumb mode: `setRegisterValue` \u002F context register `TMode=1` on the whole image range before disassembly.\n   - Seed known function addresses, or auto-analysis stays blind.\n3. **Linear sweep `disassemble()` per halfword is too slow** (flow analysis per call). Instead: generate a seed list from **Capstone BL\u002FB.W targets** (one pass in Python over the bin) plus known entry points, then let Ghidra's `disassemble` expand by control flow. ~213 seeds -> full coverage in seconds.\n4. **RAM matters.** Create the RAM memory block (e.g. `0x20000000`-`0x2003ffff`) or the decompiler cannot resolve `ldr` into ctx structures. Catch `MemoryConflictException` - the block may already exist.\n5. **Match the binary to the dump.** Decompiled addresses are meaningless across firmware versions. Record which `.bin` produced which `gh_dump.txt`; re-scan constants (e.g. `movw #0xca01`) in the SAME file.\n6. **Ghidra misreads `ldr\u002Fstr` literal-pool pairs as arrays.** `DAT_0001f334` looked 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).\n7. `analyzeHeadless \u003Cprojdir> \u003Cprojname> -import \u003Cbin> -processor \u003Clang> -cspec \u003Cc> -postScript \u003Cscript> [args] -scriptPath \u003Cdir>` - processor for Cortex-M4 Thumb LE: `ARM:LE:32:v7` (v8 for M33+).\n\n## Workflow that worked\n\n```bat\nsupport\\analyzeHeadless.bat ghproj esl -import fw.bin ^\n  -processor ARM:LE:32:v7 -postScript GhDump.java -scriptPath . -deleteProject\n```\n\nScript skeleton (Java):\n- `setRegisterValue` TMode=1 over `[imgStart, imgStart+len)`.\n- Add RAM block via `getMemory().createInitializedBlock(\"ram\", toAddr(0x20000000), size, (byte)0, monitor, false)` (or `createUninitializedBlock`).\n- Read seed addresses from `seeds.txt` (capstone-generated BL targets), `disassemble(addr)` each.\n- For each target function: `getFunctionAt`, `DecompInterface.openProgram`, `decompileFunction(fn, 60, monitor)`, print `getDecompiledFunction().getC()`.\n- Print xrefs: `getReferencesTo(addr)` \u002F `getReferencesFrom`.\n- Print `cmp`\u002F`movw` sites matching interesting immediates.\n\nCapstone seed generator (python):\n\n```python\nfrom capstone import *\ndata = open('fw.bin','rb').read(); base = 0x19000\nmd = Cs(CS_ARCH_ARM, CS_MODE_THUMB | CS_MODE_LITTLE_ENDIAN)\nseeds = set()\nfor off in range(0, len(data)-4, 2):\n    for i in md.disasm(data[off:off+4], base+off, 2):\n        if i.mnemonic in ('bl','blx','b','b.w') and i.op_str.startswith('#0x'):\n            t = int(i.op_str[1:],16)\n            if base \u003C= t \u003C base+len(data): seeds.add(t)\nopen('seeds.txt','w').write('\\n'.join(hex(s) for s in sorted(seeds)))\n```\n\n## Analysis recipes that paid off\n\n- **Find a message consumer**: producers `FUN_x(msg_id, sub, buf, len)` are easy; consumers live in other tasks. Grep disasm for `cmp rX, #\u003Cmsgid>` clusters - the real dispatcher compares several IDs in one function. Do not trust the first `movs r0,#id` (that is a producer).\n- **Follow ctx offsets, not names**: pick a struct offset (e.g. `ctx+0x118`), grep all disasm touching it - that is how you find readers\u002Fwriters when there are no xrefs (literal pools).\n- **Odd-value table entries**: `0x196f5` in a \"param table\" = Thumb func ptr (low bit). Dump code there; tiny `movs r0,#N; bx lr` getters reveal the slot is a callback column, not data.\n- **Distinguish \"committed\" vs \"rendered\" on hardware**: protocol ack != visual effect. Correlate each hypothesis test with a physical observation (flash, LED, pixels) before recording conclusions.\n\n## Outputs to keep\n\n- `gh_dump.txt`: decompiled functions + xrefs + cmp-site index, checked next to the `.bin` it came from.\n- `seeds.txt`: reproducible function seed list.\n- 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.\n\n## Cascade\n\n- `binary-triage`: cheap static triage first; Ghidra is the escalation.\n- `re-binary`: managed RE via rea-ops when its engine covers the artifact.\n- `firmware-probe`: extraction (binwalk\u002FEMBA) before RE.\n",{"name":5,"triggers":24,"description":7,"allowed-tools":27},[25,26],"user","model",[28,29,30,31],"read","exec","write","edit","main","02b95ddb62959a00b3c31442c2046aca0d19563c","skills\u002Fghidra",1,"https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle","https:\u002F\u002Fleostruka.github.io\u002Fdevin-bundle\u002F","https:\u002F\u002Fgithub.com\u002FLeostruka","2026-11-15 05:19:58",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add Leostruka\u002Fdevin-bundle --skill ghidra",{"tool":46,"command":47},"bunx","bunx skills add Leostruka\u002Fdevin-bundle --skill ghidra",{"tool":49,"command":50},"pnpm","pnpm dlx skills add Leostruka\u002Fdevin-bundle --skill ghidra","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fghidra\u002FSKILL.md",true,[],[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7E0K3MG2XC4FSRV0MK6SFR1","montador-de-ideias","Use when assembling, expanding, or elevating a raw project idea or initial prompt into an ultra-detailed, first-principles dossier and compiled master prompt with journalistic OSINT market research, Tech Lead and Staff Architect justifications, atomic and modular hardening\u002Foptimization, and high-impact contact surfaces.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fmontador-de-ideias\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7E0J7JJWZ8QMK01RZ3B3C9Z","git-github-adaptive-engineering","Use when any task touches git history, GitHub issues\u002FPRs\u002Freleases\u002FCI, repo governance, or branch and merge decisions. Runs the Fase Zero situational-awareness battery, picks one of five delivery flows via the adaptive decision engine, and enforces commit\u002FPR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug\u002Ffinish skills.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fgit-github-adaptive-engineering\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7E0GJFRPFEVQQMXEM58EWDM","adaptive-agenda-calendar-routine-engine","Use when planning or executing work across hours, days, weeks, or sprints. Turns the calendar into a strict time-blocked agenda (HH:MM-HH:MM blocks carrying a routine profile, expected inputs, and a handoff output artifact), runs the 5-stage cognitive flow (Radar and Hunt -> Triage plus Steve Jobs conception -> workbench manifest -> >=32-cycle loop -> Close plus Open-Minded Scrum), and unfolds macro calendar milestones into micro agenda blocks through extensions\u002Fgcal\u002Fwrapper.py.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fadaptive-agenda-calendar-routine-engine\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7AE2K9FTY0BVS48N0A9JFKF","demo","Use when demonstrating a skill in a fixture project.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AE2G3DP38PTV3B1N7MW5TS","duplicate-skill","Use when testing duplicate skill name detection.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":91,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7AE2DBR8ZHT6T875MJ392GK","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Falpha\u002FSKILL.md",[],[]]