humanify  by jehna

CLI tool for JavaScript deobfuscation using LLMs

created 2 years ago
2,447 stars

Top 19.4% 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

3 days ago

Responsiveness

1 day

Pull Requests (30d)
43
Issues (30d)
4
Star History
234 stars in the last 90 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
1 more.

promptable by cfortuner

0%
2k
TS/JS library for building full-stack AI apps
created 2 years ago
updated 2 years ago
Starred by Simon Willison Simon Willison(Author of Django), Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), and
1 more.

GPT-3-Encoder by latitudegames

0%
719
JS library for GPT-2/GPT-3 text tokenization
created 4 years ago
updated 2 years ago
Feedback? Help us improve.