ランキングに戻る

kuizuo/js-deobfuscator

JavaScriptjs-deobfuscator.vercel.app

An automated JavaScript deobfuscation tool based on Babel AST, with an online playground, CLI, and programmable API.

astjavascriptobfuscatordeobfuscatorbabel
スター成長
スター
1.2k
フォーク
263
週間成長
Issue
7
5001k
2021年7月2023年3月2024年11月2026年7月
成果物npmnpm install js-deobfuscator
README
JS Deobfuscator Logo

JS Deobfuscator

🚀 基于 Babel AST 的全自动 JavaScript 反混淆工具,助你高效还原各种混淆代码。

💻 立即体验 Playground →

功能亮点

功能 说明
解密入口定位 按字符串数组长度、解密器调用次数或手动注入代码/解密器名称进行定位
字符串解密 识别字符串数组与旋转器,展开解密器封装并用明文替换调用点
控制流还原 展开控制流平坦化、移除死代码/花指令、合并对象属性与赋值
代码整形 Unminify、美化、变量重命名(hex/short/custom),可选关键字标记
自卫清理 移除 self-defending / anti-debug 逻辑,支持多轮执行处理重度混淆
多形态使用 CLI、浏览器 Playground、TypeScript API,并附带真实案例集合

快速开始

CLI / 本地

git clone https://github.com/kuizuo/js-deobfuscator
cd js-deobfuscator
pnpm install

# 处理单个文件并写入目录 (生成 output.js)
pnpm exec deob path/to/input.js -o ./out

# 也可通过 stdin 使用
cat path/to/input.js | pnpm exec deob > output.js

快速体验:将混淆代码放到 tmp/input.js,执行 pnpm tmp,结果会输出到 tmp/output.js

编程接口

import { readFileSync } from 'node:fs'
import { deob } from 'deob'

const code = readFileSync('input.js', 'utf8')
const { code: outputCode, save } = await deob(code, {
  decoderLocationMethod: 'callCount',
  decoderCallCount: 300,
  mangleMode: 'hex',
})
await save('./out') // 写入 out/output.js

示例与案例

example/ 下收录了多组真实混淆样本,每个子目录包含:

  • index.ts: 配置/驱动脚本执行。
  • input.js / output.js : 输入、还原结果与美化对比。
  • setupCode.js: 运行前注入的自定义代码。

项目结构

  • packages/deob: 核心 AST 变换与 CLI (deob 二进制)。
  • website: Nuxt 3 + Monaco 的在线 Playground。
  • example: 真实混淆案例与演示脚本。
  • tmp: 简单的本地快速体验目录。

致谢

该项目引用并受到 j4k0xb/webcrack 的启发,以及书籍 反爬虫 AST 原理与还原混淆实战

関連リポジトリ
Graphify-Labs/graphify

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

PythonPyPIMIT Licenseclaude-codegraphrag
graphify.com
93.3k9k
prettier/prettier

Prettier is an opinionated code formatter.

JavaScriptnpmMIT Licenseformatterprinter
prettier.io
52.1k4.9k
babel/babel

🐠 Babel is a compiler for writing next generation JavaScript.

TypeScriptnpmMIT Licensebabeljavascript
babel.dev
44k5.9k
DeusData/codebase-memory-mcp

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

CMIT Licenseclaude-codecode-analysis
deusdata.github.io/codebase-memory-mcp/
33.8k2.6k
postcss/postcss

Transforming styles with JS plugins

TypeScriptnpmMIT Licensepostcsscss
postcss.org
29k1.6k
nikic/PHP-Parser

A PHP parser written in PHP

PHPPackagistBSD 3-Clause "New" or "Revised" Licensephpparser
17.5k1.1k
ast-grep/ast-grep

⚡A CLI tool for code structural search, lint and rewriting. Written in Rust

Rustcrates.ioMIT Licensecodemodlinter
ast-grep.github.io
15.1k417
rectorphp/rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code

PHPPackagistMIT Licensephpast
getrector.com
10.4k740
remarkjs/remark

markdown processor powered by plugins part of the @unifiedjs collective

JavaScriptnpmMIT Licensemarkdownast
remark.js.org
9k382
jquery/esprima

ECMAScript parsing infrastructure for multipurpose analysis

TypeScriptnpmBSD 2-Clause "Simplified" Licenseesprimaecmascript
esprima.org
7.1k773
Bogdan-Lyashenko/js-code-to-svg-flowchart

js2flowchart - a visualization library to convert any JavaScript code into beautiful SVG flowchart. Learn other’s code. Design your code. Refactor code. Document code. Explain code.

JavaScriptnpmMIT Licenseflowchartsvg-flowchart
7.1k480
fkling/astexplorer

A web tool to explore the ASTs generated by various parsers.

JavaScriptnpmMIT Licenseast-explorerparser
astexplorer.net
6.5k776