File formatsWorksSource available
Target: Bun standalone binaries

Recompiled Bun standalone binaries into readable source code with Claude

Platform
macOS, Linux, Windows
Outcome
Works

Evidence at a glance

Loading source evidence…

What was done

The bun-demincer tool extracts, deobfuscates, and reorganizes JavaScript source code from Bun standalone binaries, enabling round-trip reassembly into functional executables.

The bun-demincer project provides a pipeline to decompile, deminify, and deobfuscate standalone JavaScript binaries produced by the Bun runtime. The tool extracts embedded JavaScript from the binary format, splits the code into individual modules, and classifies them as either vendor or application code using a fingerprint database. The deobfuscation process includes structural transforms, identifier recovery via MR() export mappings, and class name pattern matching. Claude Opus 4.6 contributed to the development of the pipeline, including the implementation of round-trip reassembly, which allows modified modules to be rebuilt into a functional binary. For remaining identifiers, the tool supports AI-assisted renaming using LLMs to infer semantic names from context. The pipeline also includes dependency graph generation and Louvain community detection to organize modules into semantic directories. The author reports that the extracted code is runnable, and the tool has been tested on output from Bun 1.3.10. Detailed documentation is available at https://raw.githubusercontent.com/vicnaum/bun-demincer/HEAD/README.md.

Reproduce it

setup
npm install
node src/extract.mjs /path/to/bun-binary extracted/
node src/resplit.mjs extracted/bundle.js resplit/
node src/match-vendors.mjs resplit/ --db data/vendor-fingerprints-1000.json --classify
node src/deobfuscate.mjs --dir decoded/

Community

Ask a question, share what worked, or follow the next milestone.

Your library