How to · open model + local harness + REA

Break the restriction: your unlocked agent, on your computer

An open model that doesn't refuse legitimate reverse engineering, the dsh harness running locally, and REA connecting to Ghidra. Point it at an app and ask it to make your version.

Your unlocked agent: open model + local harness + REA
In short

This is a guide to recreating a computer program your way using three open components: a local agent harness (the dsh, DeepSeek's coding agent), an "unlocked" open model running in Ollama, and REA, which gives the agent reverse engineering tools such as Ghidra. It's for programmers and students who want to understand how an app works and make their own version, without relying on cloud models that sometimes refuse the request. Everything runs on your machine: you need Docker, Ollama, Node 22, and enough memory for a 14 to 24 GB model. Expect to get about 80% of the app, not the final stretch.

What it is

Three parts that fit together

The model is the brain, the harness is the body with the tools, and REA is the eyes that see inside the compiled app.

Local harness, unlocked model, REA + Ghidra, choose the target, iterate, responsible use

🧰 Local harness (dsh)

The workbench where the agent lives: it reads and writes files, runs commands, and calls MCP tools. Here it runs in a container, only at the local address, and lets you switch models.

🧠 Unlocked model

An "abliterated" version of an open model: its refusal reflex has been removed. It runs in Ollama on your machine, with no API key and nothing sent outside.

🔍 REA + Ghidra

REA (Reverse Engineer Anything) is an MCP server and command line tool that provide the agent with app analysis: modules, functions, connections, with evidence and limits.

How it works

From a closed app to your own version

The agent doesn’t need to be brilliant: REA already organizes the tools, and the model just executes. That’s why a mid-sized open model can handle much of the work.

You point to the app→ dsh (harness)→ model in Ollama→ REA→ Ghidra or JS analysis→ evidence→ new code, from scratch→ you test and iterate

🎬 The reference video example

The Mac video player (QuickTime) offers only a few fixed speeds. The agent studied the app and created a new one, with a different name ("Tempo") and icon, granular speed control, audio waveforms, and pitch adjustment. About 80% was done in a single request; the rest was sources, visuals, and export.

📏 The video’s numbers (not measured here)

  • 1st version: 20 to 30 min and US$ 4 for a cloud model.
  • Adjustments through the final version: another US$ 5 to 6.
  • Result: ~80% in a single request.
  • Running locally, the only costs are the machine and electricity.
Honest limitations. What lives on the manufacturer’s server doesn’t come with it (for example: PowerPoint’s SmartArt diagram library is in the cloud, so the clone makes shapes and text, but not SmartArt). REA gets you to ~80%, not the last mile. And frontier models (Claude, Codex, Gemini) sometimes refuse parts of this work and may close the door even further: that’s why the local model comes in.
The brain

Unrestricted models checked on Ollama

Only what actually exists on the Ollama page on 12/10/2026 (the "tags" tab for each model). None were downloaded or measured on this machine: the disk was at 98%. Choose based on what fits in your memory.

Model (exact command)SizeFeatures on the pageNotes
ollama pull huihui_ai/Qwen3.8-abliterated:27b18 GB (q4_K_M)tools · thinking · visionSame base as qwen3.8:27b, which already runs in dsh here. First choice. not measured
ollama pull huihui_ai/Qwen3.6-abliterated:35b-a3b24 GBtools · thinking · visionMoE (3B active per token): tends to be fast. not measured
ollama pull huihui_ai/glm-4.7-flash-abliterated19 GBtools · thinkingGLM family, same as in the video example (that one was a larger cloud version). not measured
ollama pull huihui_ai/gpt-oss-abliterated:20b14 GBtools · thinkingThe smallest on the list with tools. Good for a 32 GB machine. not measured
ollama pull huihui_ai/qwen3-coder-abliterated:30b19 GBno "tools" tag on the pageFocused on code, but check the tools tag: without tool calling, the agent won’t use REA. not measured
Why "tools" matters. The harness can use REA only if the model knows how to call tools. The Ollama page for each model shows the tools, thinking, and vision tags. Without tools, the model chats but doesn’t act.

Don’t have a machine for this? There are prepaid third-party cloud services (like OpenRouter, which dsh already supports in ./dsh remoto mode) that host unrestricted models, with US$ 5 to 10 in credit. Then the app code leaves your machine, and in remote mode dsh deliberately doesn’t mount ~/projetos.
Prerequisites

What needs to be ready

Tested as a reference on an ARM Linux machine (DGX GB10, 128 GB unified memory). On another machine, the commands are the same; the sizes that fit will vary.

🐳 Docker + dsh-sandbox

dsh (@deepseek-ai/dsh 0.1.1-rc.1) in a node:22-slim container, 3 GB limit, non-root user, only on 127.0.0.1:9080.

cd ~/projetos/dsh-sandbox
./dsh status   # mode, container, http, providers

🦙 Ollama

Port 11434, 32K context and q8_0 KV cache in the service. Check what’s already installed and the disk space before pulling a model.

ollama list
df -h /        # the model needs 14 to 24 GB free

🟢 Node.js 22.19+

REA requires Node 22.19+, 24.11+ or 26+. The dsh container already includes 22.23.

docker run --rm node:22-slim node -v   # v22.23.x

🐉 Ghidra 12.1.x + JDK 21 (native binaries only)

For compiled apps (C, C++, Swift, Rust). On Linux ARM64, the native decompiler may need to be compiled separately. This machine has only JDK 8, so this path is not measured. Electron/JavaScript apps don’t need Ghidra.

java -version   # needs to be 21 or newer
Step by step

Five steps, from the harness to your version

The full prompts to copy and paste are in the repository’s prompts/ folder (in Portuguese).

1

Start the harness in local mode

local mode mounts ~/projetos at /projetos and leaves Ollama as the only provider: nothing leaves the machine. Open the dashboard and choose the workspace.

cd ~/projetos/dsh-sandbox
./dsh local     # ~20 s; then open http://127.0.0.1:9080
./dsh status    # should show: local mode, /projetos mounted YES, providers: ollama
# from another machine: ssh -L 9080:127.0.0.1:9080 usuario@servidor
2

Pull an unrestricted model and point dsh to it

Download one from the table above. Then add the model to settings.local.yaml (not to work/.dsh/settings.yaml, which is overwritten each time the mode changes), under llm-pi-ai → providers → ollama → models. The id must match ollama list character for character.

ollama pull huihui_ai/Qwen3.8-abliterated:27b
ollama list | grep abliterated
# settings.local.yaml — add to the ollama provider's models list
        - id: huihui_ai/Qwen3.8-abliterated:27b
          name: Qwen3.8 27B unrestricted
          contextWindow: 32768
          maxTokens: 8192
          reasoningEfforts:
            off: none     # explicit "none": empty leaves reasoning ON in Ollama
            low: low
            high: high
            max: high
./dsh local     # copies settings.local.yaml to the container (no rebuild)

The new model appears in the dashboard selector. The provider's compat block (supportsDeveloperRole: false, maxTokensField: max_tokens) is already in the file and is required for Ollama.

3

Install REA (and Ghidra for native binaries)

Path A — Electron/JavaScript app, no Ghidra. The agent runs REA from the command line inside the container. This was the path measured here: REA 6.3.0 analyzed a 97-file Node app in 20 s; REA 6.4.0 analyzed an Electron app with 202 JS files in 94.5 s (1.26 GB peak). Put the target in a folder the container can see (~/projetos/dsh-sandbox/work/alvos becomes /work/alvos) and paste the prompt:

Install this and help me reverse engineer an app: https://github.com/morluto/rea
Use npx -y rea-agents@6.4.0, always preceded by "timeout -k 10 600".
Analyze /work/alvos/<app>.asar with analyze-javascript-application --json,
summarize modules, screens, and where <the function I’m interested in> is, with evidence.

Path B — REA as MCP inside dsh (not measured). Automatic registration with rea setup --client dsh is not in the published package yet (REA docs say "only on main, after 6.4.0"). The manual approach: install REA in its own folder under work/ (without touching dsh's frozen node_modules) and register the server in dsh home’s cordis.patch.yml.

cd ~/projetos/dsh-sandbox
docker run --rm -u 1000:1000 -v "$PWD/work:/work" -w /work \
  -e HOME=/work -e NPM_CONFIG_CACHE=/work/.npm --memory=6g \
  node:22-slim npm install --prefix /work/rea rea-agents@6.4.0
# ~/projetos/dsh-sandbox/work/.dsh/cordis.patch.yml  (inside container: /work/.dsh/cordis.patch.yml)
- insert:
    - id: rea-mcp
      name: "@deepseek-ai/dsh-mcp-client"
      config:
        serverName: rea
        transport: stdio
        command: /usr/local/bin/node
        args: ["/work/rea/node_modules/rea-agents/scripts/rea.mjs", mcp]
        toolCallTimeoutMs: 600000   # default is 60 s; an analysis takes longer

Restart with ./dsh local; the tools appear as mcp__rea__…. For native binaries, REA needs Ghidra 12.1.x and JDK 21 visible from inside the container (GHIDRA_INSTALL_DIR, JAVA_HOME) and more memory than the container’s 3 GB. This was not set up or measured here.

4

Choose the target and ask for your version

Start with a small app that you use and miss just one thing in. Ask for a new app, with your own name and icon, written from scratch, and with a list at the end of what was left out.

Based on the analysis, create a NEW app, with its own name and icon (no name, icon,
text, or code from the manufacturer), that does what <original app> does in <main function>
and add: playback speed from 0.1x to 4x, in steps of 0.05.
Write the code from scratch in /work/minha-versao. First, make the smallest working version;
at the end, list what was left out and what needs manual testing.
5

Iterate, one change at a time

The first version usually works for the essentials. The rest is tuning: appearance, export, small errors. One request at a time, testing between each one.

I opened version 1. What didn’t work: <what you saw, with the error message>.
Fix only that, run it again, and tell me how to confirm it’s right.
Stop. Summarize in 5 lines what you’ve tried, what errored, and what the hypothesis is.
Don’t run anything else until I respond.   # when the agent gets stuck
Checklist

Before saying it worked

Check each item. If any fail, go to "Troubleshooting".

Environment

  • ./dsh status shows local mode, http 200, and /projetos mounted.
  • ollama list shows the unrestricted model with the same name as the id in the YAML.
  • The model responds in the panel and can run ls /work (proof that it calls tools).
  • npx -y rea-agents@6.4.0 --help runs from inside the agent.

Result

  • The analysis returned evidence (file and excerpt), not just an opinion.
  • The new app has your own name and icon and no files copied from the original.
  • The feature missing from the original really works (manual test).
  • The agent listed what was left out (server, unseen parts).
Troubleshooting

When something gets stuck

Cases that have already come up on this machine or are described in the REA and dsh documentation.

⏱️ REA stuck

REA 6.3.0 got stuck on an app with one huge JS file and ignored SIGTERM: the orphan had to be killed by PID. In 6.4.0, the same app finished. Even so, always run with a limit:

# on the host (systemd-run + timeout) or in the container (timeout):
scripts/rea-com-timeout.sh -t 600 -m 6G -- \
  npx -y rea-agents@6.4.0 analyze-javascript-application /abs/app.asar --json

🧠 Model too small

Signs: makes up tool names, repeats the same command, forgets the goal. Switch to a larger one from the table, split the request into smaller parts, and tell the agent to save the analysis summary to a file to reread later. The 32K context fills up quickly with large JSON: ask for a summary, not the whole JSON.

🐉 Ghidra / Java

REA accepts Ghidra 12.1.x with JDK 21+ (64-bit, with javac). JDK 8 won't work. On Linux ARM64, check the Ghidra/Features/Decompiler/os/linux_arm_64 folder. Diagnostics:

npx -y rea-agents@6.4.0 doctor --provider ghidra --json

🔌 dsh doesn't show REA tools

Check the path to rea.mjs inside the container, the node command (/usr/local/bin/node), and that cordis.patch.yml isn't empty (a file with only comments causes an error). Check the log:

docker compose logs --tail=50

🧩 Model doesn't appear in the selector

The id doesn't match ollama list, or you edited work/.dsh/settings.yaml and ./dsh local overwrote it. Edit settings.local.yaml and run ./dsh local again.

📂 The agent can't find the app

The container can only see /work and, in local mode, /projetos. Copy the app (or the .asar) to ~/projetos/dsh-sandbox/work/alvos/ and use the absolute path from inside the container.

Costs

Pay-as-you-go cloud or your own machine

REA, Ghidra, dsh, and Ollama are free. The model is what costs money.

ScenarioCostSource
Unrestricted cloud model (prepaid)US$ 4 for the 1st version + US$ 5 to 6 for adjustmentsreference video not measured here
Local model in OllamaR$ 0 per request; machine and electricity onlyno API key
Time to the 1st version20 to 30 min (cloud); local depends on the model and machinereference video not measured here
Local model memory14 to 24 GB (model table); dsh itself uses ~85 MBOllama page + dsh-sandbox measurement
No guardrails · cloud

No machine? Two OpenRouter-style platforms

Claude, Codex and Gemini sometimes refuse parts of a reverse-engineering job, even a legitimate one. The way out is an open model that does not refuse. If your computer cannot run the model, these two prepaid platforms host it for you: add US$ 5 to 10 in credit, get the key and ask your agent (dsh, Claude Code, Codex) to use it.

1. abliteration.ai

Open "abliterated" models (the refusal reflex removed from the weights), through an OpenAI-compatible API. Prepaid per token or monthly plan.

# API endpoint
https://api.abliteration.ai/v1

Open the site →

2. OrcaRouter

A router with 200+ models behind a single endpoint, just like OpenRouter. It has an open-source (MIT) version you can host yourself.

Open the site →

Heads up: in the cloud, your code leaves your machine. For your own app or sensitive files, prefer a local model (Ollama). Prices and catalogs change: check the page before adding credit.

Responsible use

"Unrestricted" doesn't mean "no rules"

Unrestricted means the model doesn't refuse legitimate reverse engineering tasks. It doesn't mean anything illegal is allowed.

✅ Allowed

  • Study a program you own and use to understand how it works.
  • Build your own version for personal use and interoperability (open your files, connect with your tools).
  • Write the code from scratch, with your own name, icon, and look.

⛔ Not allowed

  • Redistribute the manufacturer's code, icons, text, or trademarks.
  • Sell a copy of a program: that runs into copyright law and the license.
  • Break copy protection, licensing, or DRM, or target a program you have no right to use.
  • Run an unknown binary outside an isolated machine: REA is not a sandbox.
Many software licenses prohibit reverse engineering; laws vary by country. When in doubt, stay on safe ground: your own programs, open source, security challenges, and anything you have permission to analyze.
Video

Watch the video

The video for this guide, with the steps explained.

▶ Watch the video
Transparency

What was measured and what wasn't

So you know what you can rely on.

ItemStatusDetails
dsh in local mode with OllamameasuredBoot ~18 s, ~85 MB idle, qwen3.8:27b ~18–20 GB (dsh-sandbox, 08/2026).
REA, JS analysis without Ghidrameasured6.3.0: 97 files in 20 s; 6.4.0: 202 JS files in 94.5 s, peak 1.26 GB (Linux ARM, 10–12/10/2026).
REA hanging on a huge JS filemeasured6.3.0 hung and ignored SIGTERM; 6.4.0 finished. The limit with scripts/rea-com-timeout.sh was tested in both modes.
Unrestricted models from the tablenot measuredChecked on the Ollama page; none downloaded (disk at 98%).
REA as MCP inside dshnot measuredManual instructions based on the REA and dsh-mcp-client 0.1.1-rc.1 docs.
Ghidra on this machinenot measuredOnly JDK 8 is available; Ghidra 12.1.x requires JDK 21 and, on ARM64, its own native decompiler.
The QuickTime clone, costs, and timesnot measuredNumbers from the reference video (macOS, cloud model).
Next steps

What remains to be measured

Open items in this guide, ordered by impact.

Phase 1
Measure an unrestricted model in dshDownload huihui_ai/Qwen3.8-abliterated:27b when disk space is available and run path A in a small Electron app: time, memory, and how many requests until the 1st version.
Phase 2
REA as MCP in dshApply cordis.patch.yml, confirm the mcp__rea__… tools in the panel and toolCallTimeoutMs.
Phase 3
Ghidra on Linux ARM64JDK 21 + Ghidra 12.1.x with the linux_arm_64 decompiler, visible in the container, for native binaries.

Previous guide, with the technique, cases, and 6.4.0 retest: REA, AI-assisted reverse engineering (in Portuguese). REA repository: morluto/rea (MIT, ~147 thousand stars on 12/10/2026).