Agent skill

Nes Decompile

by jonathanpeppers in jonathanpeppers/dotnes

Decompile NES ROM files (.nes) into C projects that can be rebuilt with dotnes.

MITAuto-check passedSecurity

Install Nes Decompile

skills CLI
$ npx skills add jonathanpeppers/dotnes --skill nes-decompile -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jonathanpeppers/dotnes nes-decompile --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jonathanpeppers/dotnes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/nes-decompile .claude/skills/nes-decompile && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nes-decompile
GitHub stars
780
Token cost
~1.6k tokens
SKILL.md length
527 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Decompile NES ROM files (.nes) into C projects that can be rebuilt with dotnes.

  • Works in 3 steps: Build Symbol Table → Decompile Main → Generate C
  • The user wants to decompile a ROM
  • SKILL.md covers Decompiler Tool, Common Workflows, How the Decompiler Works and MSBuild Properties in…, plus 1 more section
  • Calls dotnet and python

What it does

Nes Decompile is an agent skill from jonathanpeppers/dotnes. Decompile NES ROM files (.nes) into C projects that can be rebuilt with dotnes. Use this skill whenever the user wants to decompile a ROM, reverse-engineer a .nes file, convert a ROM to C, extract code from a NES ROM, create a project from an existing ROM, or do a round-trip test (transpile → decompile → retranspile). Also use when the user says things like "decompile this ROM", "turn this .nes into C", "extract the code", "what does this ROM do", "reverse engineer", or "round-trip". This is the high-level…

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Reverse engineering and malware. It works with C# and .NET. The repository describes itself as: .NET for the NES game console. The licence is MIT.

When your agent uses it

  • The user wants to decompile a ROM
  • Reverse-engineer a .nes file
  • Convert a ROM to C
  • Extract code from a NES ROM

Example prompts

  • “decompile this ROM”
  • “turn this .nes into C”
  • “extract the code”
  • “/nes-decompile”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Build Symbol Table
  2. Decompile Main
  3. Generate C

What it can do on your machine

Read from SKILL.md and the folder at commit 42ca23d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nes Decompile loads about 1.6k tokens when it runs. Until then it costs about 152 tokens; SKILL.md has 527 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~152
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jonathanpeppers/dotnes at commit 42ca23d, republished under its MIT licence (© jonathanpeppers). 527 words, ~1,622 tokens.

Download SKILL.mdSave it as .claude/skills/nes-decompile/SKILL.md (or your agent's skills folder).
name
nes-decompile
description
Decompile NES ROM files (.nes) into C# projects that can be rebuilt with dotnes. Use this skill whenever the user wants to decompile a ROM, reverse-engineer a .nes file, convert a ROM to C#, extract code from a NES ROM, create a project from an existing ROM, or do a round-trip test (transpile → decompile → retranspile). Also use when the user says things like "decompile this ROM", "turn this .nes into C#", "extract the code", "what does this ROM do", "reverse engineer", or "round-trip". This is the high-level decompilation tool — for low-level 6502 disassembly, use nes-rom-debug instead.

NES ROM Decompiler

Decompile .nes ROM files into complete C# projects that can be rebuilt through dotnes.

Decompiler Tool

The decompiler lives at src/dotnes.decompiler/ and is a .NET CLI tool.

Running the Decompiler
bash
dotnet run --project src/dotnes.decompiler -- <input.nes> [output-directory]
  • <input.nes> — Path to the NES ROM file (required)
  • [output-directory] — Where to write the C# project (optional; defaults to the ROM filename without extension)

Examples:

bash
# Decompile a sample ROM (build it first if needed)
cd samples/hello && dotnet build && cd ../..
dotnet run --project src/dotnes.decompiler -- samples/hello/bin/Debug/net10.0/hello.nes hello-decompiled

# Decompile any .nes ROM
dotnet run --project src/dotnes.decompiler -- path/to/game.nes game-decompiled

# Decompile with default output directory (uses ROM filename)
dotnet run --project src/dotnes.decompiler -- myrom.nes
Output Files

The decompiler generates a complete, buildable C# project:

FileDescription
Program.csDecompiled C# source with recovered NESLib API calls
{name}.csprojMSBuild project with NES configuration from ROM metadata
chr_generic.sCHR ROM data as ca65 assembly (only if ROM has CHR banks)
What Gets Recovered

The decompiler recognizes these NESLib API calls:

CategoryFunctions
Palettepal_col(palette, color)
VRAMvram_adr(NTADR_A(x, y)), vram_write("string")
PPU controlppu_on_all(), ppu_on_bg(), ppu_on_spr(), ppu_off()
Sprites/OAMoam_clear(), oam_size(), oam_hide_rest()
CHR bankingbank_spr(), bank_bg()
Inputpad_poll(0)
Timingdelay(frames), waitvsync()
Randomrand8(), set_rand()

String literals in vram_write() are recovered from ROM data when the bytes are printable ASCII. VRAM addresses passed to vram_adr() are decompiled back to NTADR_A(x, y) macro form when they match the nametable pattern 0x2000 + y*32 + x.

What Is NOT Recovered
  • Original variable names, control flow structures, or algorithm intent
  • User-defined functions (inlined into main)
  • Local variables and complex expressions
  • Non-NESLib subroutine calls (appear as comments)
  • Classes, objects, or BCL usage (NES doesn't support these)

Common Workflows

Decompile a dotnes sample ROM

Build the sample, then decompile its ROM output:

bash
# Build the sample
cd samples/hello && dotnet build && cd ../..

# Decompile the ROM
dotnet run --project src/dotnes.decompiler -- samples/hello/bin/Debug/net10.0/hello.nes hello-decompiled

# Inspect the output
cat hello-decompiled/Program.cs
Round-trip test (transpile → decompile → retranspile)

Verify the decompiler produces code that builds back to an equivalent ROM:

bash
# 1. Build original sample
cd samples/hello && dotnet build && cd ../..

# 2. Decompile the ROM
dotnet run --project src/dotnes.decompiler -- samples/hello/bin/Debug/net10.0/hello.nes hello-roundtrip

# 3. Build the decompiled project
cd hello-roundtrip && dotnet build && cd ..

# 4. Compare the two ROMs
python scripts/compare_rom.py samples/hello/bin/Debug/net10.0/hello.nes hello-roundtrip/bin/Debug/net10.0/hello.nes

If the round-trip produces an identical ROM, the decompiler recovered all observable behavior.

Decompile an external .nes ROM

Any iNES-format ROM can be parsed, but the decompiler only recognizes dotnes/neslib patterns:

bash
dotnet run --project src/dotnes.decompiler -- external-game.nes game-output
cat game-output/Program.cs

For ROMs not built with dotnes, the output will contain fewer recognized API calls and more comments for unrecognized subroutines.

Inspect ROM metadata without full decompilation

Use the decompiler's console output to quickly check ROM properties:

powershell
dotnet run --project src/dotnes.decompiler -- myrom.nes 2>&1 | Select-Object -First 6

This shows PRG/CHR bank counts, mapper number, mirroring mode, and interrupt vectors.

Show full SKILL.md (200 more words)Show less

How the Decompiler Works

The decompiler uses a three-phase algorithm:

Phase 1: Build Symbol Table
  • Assembles the known neslib built-in subroutines to determine their addresses
  • Finds main() by scanning the initlib block for the first JSR to an address past the built-ins
  • Pattern-matches final built-ins (pusha, pushax, popa, vram_write, etc.) using byte signatures
Phase 2: Decompile Main
  • Collects all 6502 instructions from main until the infinite loop (JMP to self)
  • Uses look-ahead pattern matching to recognize multi-instruction sequences:
    • LDA #imm / JSR pusha → 8-bit argument push
    • LDA #lo / LDX #hi / JSR pushax → 16-bit pointer push
    • LDX #hi / LDA #lo / JSR <sub> → call with 16-bit register argument
    • LDA #imm / JSR <sub> → call with immediate argument
Phase 3: Generate C#
  • Converts the recognized patterns into NESLib API calls with recovered arguments
  • Reconstructs string literals and NTADR_A macro addresses
  • Wraps everything in the standard dotnes program structure

MSBuild Properties in Generated .csproj

The decompiler reads ROM metadata and sets appropriate MSBuild properties:

PropertyConditionExample
NESMapperMapper ≠ 0<NESMapper>1</NESMapper>
NESPrgBanksPRG banks ≠ 2<NESPrgBanks>4</NESPrgBanks>
NESChrBanksCHR banks ≠ 1<NESChrBanks>2</NESChrBanks>
NESVerticalMirroringMirroring is vertical<NESVerticalMirroring>true</NESVerticalMirroring>
  • nes-rom-debug — Low-level 6502 disassembly and byte-level ROM inspection
  • nes-emu-debug — Run ROMs in MesenCE emulator to verify runtime behavior

© jonathanpeppers, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/nes-decompile of jonathanpeppers/dotnes.

Open the folder on GitHubat commit 42ca23d

Compare with similar skills

Nes Decompile next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nes Decompile compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nes Decompile this skilljonathanpeppers/dotnes780—~1.6kAutomated safety check: PassMIT
Scaffoldingdotnet/efcore15k—~165Automated safety check: PassMIT
Dotnet Inspect Decompilerrichlander/dotnet-inspect151—~2.4kAutomated safety check: PassNone
Dotnet Decompilerptn1411/skill219—~929Automated safety check: NotesNone
Ctf Malwareljagiello/ctf-skills3.4k1 repos~2.1kAutomated safety check: NotesMIT
Patch Diff AnalyzerHacktronAI/skills115—~2.2kAutomated safety check: PassMIT

Similar skills

  • Scaffolding

    dotnet/efcore

    Official

    Implementation details for EF Core scaffolding (reverse engineering).

    15k GitHub stars~165 tokensUpdated today
    SecurityAuto-check passed
  • Dotnet Inspect Decompiler

    richlander/dotnet-inspect

    Reconstruct a method or type as C and IL — decompiled source, annotated source with hidden facts, raw IL, fidelity levels, and IL-offset lookup.

    151 GitHub stars~2.4k tokensUpdated today
    SecurityAuto-check passed
  • Dotnet Decompiler

    ptn1411/skill

    Automated .NET/C decompilation and security analysis. An agent skill from ptn1411/skill.

    219 GitHub stars~929 tokensUpdated 16 days ago
    SecurityAuto-check: notes
  • Ctf Malware

    ljagiello/ctf-skills

    Provides malware analysis and network traffic techniques for CTF challenges.

    3.4k GitHub starsUsed in 1 repo~2.1k tokens
    SecurityAuto-check: notes
  • Patch Diff Analyzer

    HacktronAI/skills

    Specialized in reverse-engineering compiled binaries (JARs, DLLs).

    115 GitHub stars~2.2k tokensUpdated 4 mo ago
    SecurityAuto-check passed
  • Malware Analysis

    hypnguyen1209/offensive-claude

    A skill your agent uses when reverse-engineering or detecting malware — static triage + capa/YARA-X, emulation/DBI/.NET unpacking, dynamic/fileless/Volatility 3 memory analysis, C2 config extraction…

    386 GitHub stars~2.3k tokensUpdated 10 days ago
    SecurityAuto-check passed

More from jonathanpeppers/dotnes

  • Code Review

    jonathanpeppers/dotnes

    Review dotnes pull requests against established repository rules.

    780 GitHub stars~2.1k tokensUpdated 14 days ago
    Auto-check passed
  • Nes Rom Debug

    jonathanpeppers/dotnes

    Disassemble and debug NES ROM files (.nes) produced by the dotnes transpiler.

    780 GitHub stars~1.5k tokensUpdated 14 days ago
    Auto-check passed
  • PR Iterate

    jonathanpeppers/dotnes

    Iterate on a GitHub pull request from a coding agent (like Copilot coding agent) until it's ready for human review.

    780 GitHub stars~2.4k tokensUpdated 14 days ago
    Auto-check passed

Works with

Categories

Questions about Nes Decompile

What does Nes Decompile do?

Decompile NES ROM files (.nes) into C projects that can be rebuilt with dotnes. Nes Decompile is an agent skill from jonathanpeppers/dotnes.nes) into C projects that can be rebuilt with dotnes.

When should I use Nes Decompile?

Nes Decompile fits situations like: the user wants to decompile a ROM; reverse-engineer a .nes file; convert a ROM to C; extract code from a NES ROM.

How do I install Nes Decompile in Claude Code?

Run `npx skills add jonathanpeppers/dotnes --skill nes-decompile -a claude-code`. Or copy the skill folder (.github/skills/nes-decompile in jonathanpeppers/dotnes) into .claude/skills/nes-decompile in your project. Claude Code loads it when a task matches its description.

How do I install Nes Decompile in Codex?

Run `npx skills add jonathanpeppers/dotnes --skill nes-decompile -a codex`. Or copy the skill folder (.github/skills/nes-decompile in jonathanpeppers/dotnes) into .agents/skills/nes-decompile in your project. Codex loads it when a task matches its description.

Can I use Nes Decompile in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jonathanpeppers/dotnes --skill nes-decompile -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nes-decompile, .gemini/skills/nes-decompile, .github/skills/nes-decompile and .opencode/skills/nes-decompile in your project.

What does Nes Decompile need to run?

Going by SKILL.md and its folder, Nes Decompile needs the command-line tools its instructions call (dotnet and python). Our summary lists: Python 3.

Does Nes Decompile access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Nes Decompile safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nes Decompile use?

Nes Decompile is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nes Decompile use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nes Decompile?

Skills that share tags, products or a category with Nes Decompile: Scaffolding (dotnet/efcore, 15k stars), Dotnet Inspect Decompiler (richlander/dotnet-inspect, 151 stars), Dotnet Decompiler (ptn1411/skill, 219 stars) and Ctf Malware (ljagiello/ctf-skills, 3.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nes Decompile?

jonathanpeppers (a GitHub user) maintains it in jonathanpeppers/dotnes, which has 780 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 23, 2026.

Source: jonathanpeppers/dotnes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.