humanify  by jehna

CLI tool for JavaScript deobfuscation using LLMs

Created 2 years ago
2,920 stars

Top 16.3% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

HumanifyJS is a tool designed to deobfuscate, unminify, and decompile JavaScript code, making it more readable for developers. It leverages Large Language Models (LLMs) like ChatGPT and local models, combined with Babel for AST-level transformations, to rename variables and functions while ensuring code equivalence.

How It Works

The tool employs a hybrid approach. LLMs provide intelligent suggestions for renaming variables and functions, enhancing code readability. These suggestions are then integrated with Babel, a JavaScript compiler, which performs structural transformations on the Abstract Syntax Tree (AST) level. This ensures that the deobfuscated code remains functionally identical to the original, even after significant renaming and unminification.

Quick Start & Requirements

  • Install: npm install -g humanifyjs
  • Prerequisites: Node.js >= 20.
  • Usage: humanify <mode> <file.js> [--apiKey="your-token"] (modes: openai, gemini, local).
  • Local Mode Model Download: humanify download <model_name> (e.g., 2b).
  • Docs: Introduction blog post

Highlighted Details

  • Supports OpenAI, Google Gemini, and local LLM modes.
  • Utilizes Webcrack for unbundling Webpack.
  • Native support for Apple M-series chips.
  • AST-level unmanging via custom and off-the-shelf Babel plugins.

Maintenance & Community

  • Actively maintained with a renewed focus on testability and maintainability in v2.
  • Community contributions are welcomed.

Licensing & Compatibility

  • MIT License.
  • Permissive for commercial use and integration with closed-source projects.

Limitations & Caveats

Large files processed with ChatGPT may incur significant token costs (estimated at 2 tokens per character). Local mode accuracy and speed depend heavily on available hardware, with CPU execution being potentially very slow.

Health Check
Last Commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
42
Issues (30d)
3
Star History
453 stars in the last 30 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
8 more.

llm-vscode by huggingface

0.1%
1k
VSCode extension for LLM-powered code development
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.