
Reashield
io.github.HMAKT99由 GitHub 账号 HMAKT99 发布v0.7.1更新于 Nov 5, 2026
Defensive hardening against automated reverse engineering - the defensive mirror of REA.
概览
该 MCP 服务器为 AI 助手提供工具,用于检查、加固并测量 JavaScript/Electron/Python 项目,抵御自动化逆向工程。
- 可以做什么
- 检查项目的暴露面、配置、加固层与开销
- 加固已发布的代码:服务端迁移、加密封装、WASM、混淆与诱饵
- 运行真实的 REA 攻击工具,对比加固前后并给出恢复评分
- 为迁移或封装的逻辑生成服务端骨架
- 适用场景
- 当你发布自己拥有的 JavaScript、Electron 或 Python 代码,希望在对话中让助手对其进行加固以抵御自动化逆向工程,并测量攻击工具仍能恢复多少内容时使用。
- 运行要求
- 以本地 stdio 进程运行,通常通过 npx 启动。JavaScript/Electron 前端需要 Node.js 与 npm;Python 前端需单独安装。真实攻击测量需要可选的 rea-agents 包,否则只提供静态代理指标。
安装
在 SourceWeft 中
- 打开 控制台中的 Reashield,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
REAShield
[npm version] [license] [CI] [python-ci]
[REAShield demo — REA recovers 6 protected tokens, 0 after hardening]
REA reverse-engineers any app. REAShield makes it come back empty.
REA — the #1 trending repo on GitHub — lets an AI agent reverse-engineer your shipped app in one command, no source code needed. REAShield is the defensive counter: drop it into your build and it hardens what you ship (JavaScript / Electron / Python) so automated reverse engineering comes back empty.
Measured against the real attacker — not claimed
- REA (
rea-agents) recovered 6 protected tokens → 0 after hardening. - webcrack fully deobfuscated the hardened client (1103 changes, string array decoded) and still recovered 0 — because the secrets were relocated/sealed, not just obfuscated.
Python front-end: pip install reashield (see python/).
Honest promise & limits — read this
Offline code can never be made unbreakable. If a machine must run it, the machine has it, so it can always be extracted given effort — obfuscation, WASM and bytecode only raise the cost. REAShield's job is to defeat the automated attack (the one REA just handed everyone) and raise a human analyst's cost from minutes to days. The only truly unrecoverable code is code you don't ship — run it server-side (
mode: "relocate"). Defensive-only, behavior-preserving, transparent (no phone-home). It hardens code you own and ship; it won't help bypass anyone else's DRM, license checks, or anti-cheat.
Use it from an AI agent (MCP server)
REA is an MCP server that hands an agent reverse-engineering tools. REAShield ships the defensive mirror — an MCP server that hands an agent hardening tools, so Claude Code / Cursor can inspect, harden, and measure a project from chat.
Tools: reashield_doctor (what's exposed), reashield_harden (harden it),
reashield_measure (run the real REA and report the recovery score).
Two front-ends, one architecture
REAShield is a monorepo. The same durable idea — move secrets off-device, turn static facts into runtime facts, and measure the result — is implemented for two ecosystems:
Both share the pillar ordering below. The Python package mirrors relocation,
sealing (AES-GCM), string indirection, name mangling, polymorphism, decoys, and
a measurement harness — with a safety analyzer that refuses rather than
miscompiles. See python/README.md.
Interpreted / source-shipped languages are the natural fit; compiled-to-native (Go, Rust, C/C++) ship no source and are a different reverse-engineering game.
Why this works (the threat model)
REA's JavaScript/Electron path is static — it never runs your app. It reads your bundle, rebuilds a graph of modules, imports, routes, IPC channels and strings, then hands a coding agent a compact summary to reason over. It honestly leaves anything computed at runtime unresolved and drops relationships when a graph gets too big.
So the durable defenses either move secrets off-device or turn static facts into runtime facts REA can't resolve. Plain obfuscation — the thing LLM-assisted deobfuscation erodes fastest — is the replaceable outer skin, not the foundation.
Defense pillars (ordered by durability)
Install
Quick start
Config (shield.config.cjs)
protect: ["a", "b"] (a plain string array) is also accepted; each defaults to
mode: "obfuscate". You can also put the config under a reashield key in
package.json.
Presets
- low — strip maps, flatten, mangle. Fast, minimal size.
- balanced (default) — + string indirection, name homogenization, computed channels, opaque relocation boundary, structural polymorphism, 5 decoys. Low cost.
- max — + dynamic dispatch, encrypted sealing, decoy calls, control-flow
flattening, dead-code injection, self-defending, ~15 decoys. Adds latency /
CPU / size —
doctorflags it.
Bundler plugins (run hardening inside your existing build)
Instead of the CLI, harden as part of an esbuild / Rollup / Vite build. The
plugin runs the source-level pillars per module, then finalizes each output
chunk (decoys + obfuscation + source-map stripping + client-runtime injection)
and writes the server skeleton. flattenBundle is a no-op here — your bundler
already bundles; the plugin hardens its output. Configure the relocated/sealed
transport once via the global the plugin installs:
globalThis.__configureShield({ transport, keyTransport }) (or let the default
fetch transport call your endpoints).
Each plugin accepts { config | configPath, cwd, seed }. Note: the plugin
hardens every emitted JS chunk, so obfuscation cost applies to the whole output
— scope your build accordingly.
The generated server skeleton
relocate and seal emit a server-shielded/ directory holding the real
logic and keys. Never ship it to users. You run it behind your own auth +
TLS. REAShield scaffolds the Express/Fastify wiring and an in-process handler
for tests; securing the endpoint is your responsibility (it does not add
auth for you).
Auth seam (you supply it). Until you call setAuthVerifier, the endpoint is
open — secure it before shipping. The client attaches a token from a source
you configure; the server verifies it:
Adapters. adapter: "express" | "fastify" | "web" | "generic". The skeleton
always exports a cross-runtime webHandler(request: Request): Promise<Response>
that drops into Hono, Cloudflare Workers, Deno, Bun, or a Next.js route handler:
Relocated/sealed functions become async (they do a round-trip). Make sure your
call sites await them. They must be self-contained (no closure over
client-only module state).
Behavior preservation
Hardening must never change what your program does. The bundled example
(examples/sample-package) proves identical outputs before and after hardening
— including relocated and sealed code, exercised through an in-process server —
and asserts decoys never execute. Run it with npm run example:test.
Electron hardening
For Electron apps, REAShield adds an Electron-specific path (pair it with the JS pillars above):
- Dynamic IPC channel rewriting — turns literal
ipcMain/ipcRenderer/webContentschannel strings into runtime-computed ones. REA leaves dynamically-computed IPC names unresolved by design, so this directly starves its graph. Value-preserving: both sides compute the identical string. Enable withlayers.ipcChannels: true, or run standalone: - V8 bytecode (
bytenode) — ship.jscso the asar holds no readable JS: Caveat: V8 bytecode is tied to the exact V8 version — compile with your target Electron's Node/V8, or the.jscwill not load. Raises cost against automated static JS analysis; it is not unbreakable. - Defensive fuses (
@electron/fuses) — flip the packaged binary to the hardened defaults (disableRunAsNode, Node CLI inspect args andNODE_OPTIONS; enable embedded ASAR integrity validation andOnlyLoadAppFromAsar). Run after packaging, in yourafterPack:
bytenode and @electron/fuses are optional dependencies, loaded only when
you use these commands. Programmatic API: import { rewriteIpcChannels, compileToBytecode, recommendedFuses, applyFuses } from "reashield/electron".
WASM backend (numeric crown jewels)
Mark a function mode: "wasm" and REAShield compiles it to a real WebAssembly
module (emitted as binary — no external toolchain) that is instantiated
synchronously, so behavior is unchanged. The arithmetic then lives in wasm
bytes, off REA's JS module-graph path. Supported today: numeric params, const
locals, a return, + - * /, unary -, ternaries with comparison/&&/||/!
conditions, and Math.(max|min|abs|floor|ceil|round|sqrt|trunc). Anything
outside that subset falls back to in-place obfuscation, reported (never silent).
Honest limit: wasm is a harder, different analysis league — not unbreakable.
Durability: measure, don't trust
REA ships often. reashield test compares your own before/after artifact and
writes a baseline; the committed GitHub Action
(.github/workflows/reashield-regression.yml) re-measures across a matrix of
rea-agents versions and fails when a newer REA recovers more than the
baseline allows. That regression gate — not any single obfuscation trick — is
what keeps the shield strong over time.
rea-agents is an optional dev dependency. Without it, reashield test
falls back to static proxy metrics (source maps, import edges, string leakage,
protected-name leakage, secret-string removal).
Roadmap
✅ Bundler plugins (esbuild/Rollup/Vite) · ✅ Electron path (bytenode, defensive fuses, dynamic IPC rewriting) · ✅ WASM backend (numeric-subset → real wasm).
Next: broader WASM subset (control flow, strings) · broader server adapters + auth helpers · summary-view-tuned decoys · ASAR packaging integration helpers.
License
MIT. Use it to protect code you own and ship. Nothing here is a weapon against anyone else's software.
来源:README.md,提交 2c2efff
工具
0版本历史
1- v0.7.1最新Nov 5, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分