All Projects โ†’ 1egoman โ†’ Debundle

1egoman / Debundle

๐Ÿ—ƒ A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Debundle

retidy
Extract, unminify, and beautify ("retidy") each file from a webpack/parcel bundle (JavaScript reverse engineering)
Stars: โœญ 27 (-93.57%)
Mutual labels:  bundle, ast
Hexraystoolbox
Hexrays Toolbox - Find code patterns within the Hexrays AST
Stars: โœญ 202 (-51.9%)
Mutual labels:  ast, reverse-engineering
Pinctf
Using Intel's PIN tool to solve CTF problems
Stars: โœญ 399 (-5%)
Mutual labels:  reverse-engineering
Orgajs
parse org-mode content into AST
Stars: โœญ 417 (-0.71%)
Mutual labels:  ast
Doctrineenumbundle
๐Ÿ“ฆ Provides support of ENUM type for Doctrine in Symfony applications.
Stars: โœญ 410 (-2.38%)
Mutual labels:  bundle
Sonatadoctrineormadminbundle
Integrate Doctrine ORM into the SonataAdminBundle
Stars: โœญ 400 (-4.76%)
Mutual labels:  bundle
Ios Apm Secrets
ใŠ™๏ธ WIP ๆทฑๅบฆๆญ็ง˜ๅ„ๅคง APM ๅŽ‚ๅ•† iOS SDK ่ƒŒๅŽ็š„ๆ ธๅฟƒๆŠ€ๆœฏๅ’Œๅฎž็Žฐ็ป†่Š‚ ๆ›ดๆ–ฐไธญโ€ฆโ€ฆ
Stars: โœญ 414 (-1.43%)
Mutual labels:  reverse-engineering
Rigelengine
A modern re-implementation of the classic DOS game Duke Nukem II
Stars: โœญ 393 (-6.43%)
Mutual labels:  reverse-engineering
Domain generation algorithms
Some results of my DGA reversing efforts
Stars: โœญ 417 (-0.71%)
Mutual labels:  reverse-engineering
Sec skills
่ฝฏไปถๅฎ‰ๅ…จๅทฅ็จ‹ๅธˆๆŠ€่ƒฝ่กจ
Stars: โœญ 410 (-2.38%)
Mutual labels:  reverse-engineering
Pwndra
A collection of pwn/CTF related utilities for Ghidra
Stars: โœญ 417 (-0.71%)
Mutual labels:  reverse-engineering
Eightpointsguzzlebundle
โ›ฝ๏ธ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
Stars: โœญ 407 (-3.1%)
Mutual labels:  bundle
Doctrinebundle
Symfony Bundle for Doctrine ORM and DBAL
Stars: โœญ 4,225 (+905.95%)
Mutual labels:  bundle
Amoco
yet another tool for analysing binaries
Stars: โœญ 413 (-1.67%)
Mutual labels:  reverse-engineering
Php Parser
๐ŸŒฟ NodeJS PHP Parser - extract AST or tokens (PHP5 and PHP7)
Stars: โœญ 400 (-4.76%)
Mutual labels:  ast
Elm Analyse
A tool that allows you to analyse your Elm code, identify deficiencies and apply best practices.
Stars: โœญ 418 (-0.48%)
Mutual labels:  ast
Dex Oracle
A pattern based Dalvik deobfuscator which uses limited execution to improve semantic analysis
Stars: โœญ 398 (-5.24%)
Mutual labels:  reverse-engineering
Rollup Plugin Visualizer
๐Ÿ“ˆโš–๏ธ Visuallize your bundle
Stars: โœญ 405 (-3.57%)
Mutual labels:  bundle
Rector
Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
Stars: โœญ 4,739 (+1028.33%)
Mutual labels:  ast
Reverseapk
Quickly analyze and reverse engineer Android packages
Stars: โœญ 419 (-0.24%)
Mutual labels:  reverse-engineering

Debundle

debundle

This is a tool built to unpack javascript bundles prudiced by webpack and browserify.

Build Status


๐Ÿ‰ HERE BE DRAGONS! ๐Ÿ‰

This was a research project that is no longer maintained. I built to help me understand how javascript bundles are strutured. It works in a labratory environment most of the time, but often fails on real-world javascript bundles. It's been a while since I worked on this project so if you run into issues, I might not really be able to help you out all that much.


Why would I want to debundle my code?

Reasons vary, but this tool was originally developed to help me with a reverse engineering project. Needless to say, sifting through minified bundles to try and figure out how a service works isn't fun and is a lot easier when that bundle is broken into files and those files have semantic names.

Installation

npm i -g debundle

Running

$ debundle
Usage: debundle [input file] {OPTIONS}

Options:
   --input,  -i  Bundle to debundle
   --output, -o  Directory to debundle code into.
   --config, -c  Configuration file

$ curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/bundle.js > bundle.js
$ curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/debundle.config.json > debundle.config.json
$ cat debundle.config.json
{
  "type": "browserify",
  "knownPaths": {}
}
$ debundle -i bundle.js -o dist/ -c debundle.config.json
$ tree dist/
dist/
โ”œโ”€โ”€ index.js
โ””โ”€โ”€ node_modules
    โ”œโ”€โ”€ number
    โ”‚   โ””โ”€โ”€ index.js
    โ””โ”€โ”€ uuid
        โ”œโ”€โ”€ index.js
        โ”œโ”€โ”€ lib
        โ”‚   โ”œโ”€โ”€ bytesToUuid.js
        โ”‚   โ””โ”€โ”€ rng.js
        โ”œโ”€โ”€ v1.js
        โ””โ”€โ”€ v4.js
4 directories, 7 files

Configuration

Simple configuration

{
  "type": "browserify",
  "entryPoint": 1,
  "knownPaths": {}
}

(To debundle a simple Webpack bundle, replace browserify the above configuration with webpack)

A configuration can have a number of flags - they are documented in DOCS.md.

FAQ

Is debundling lossless? Ie, if I bundle my code then debundle, will I get the same source that was originally bundled?

No. There a bunch of metadata that's lost when bundling:

  • Any custom package.json settings for each node_module and the root package.
  • In a webpack bundle, the names of modules aren't in the bundle. By default, debundling will produce files named after the module id (ie, 1.js) unless manually overridden.
  • If your code was minified, the output files from the debundling process will also be minified (ie, no whitespace, single letter variables, etc). It's up to you to run source through other tools to make it look nicer.

My debundled code can't be run!

  • Make sure that either when rebundling or running with node that you're using the correct file as your entrypoint.
  • Read through all the configuration options. Some of them have caveats.
  • You could have run into an edge case that I haven't seen yet. Feel free to open an issue if you believe that to be the case.

Does this tool support bundles made by tools other than Browserify and Webpack?

Not officially. However, if a bundle shares the same type module layout as Browserify or Webpack it may be possible to set the moduleAst configuration option to point to the location of the modules.

Contributing

  • After cloning down the project, run npm install - that should be it.
  • Debundler entry point is ./src/index.js (that's how you run it!)
  • A bunch of sample bundles are in test_bundles/. A script, test_bundles/run_test.sh can run the debundler against a given bundle and try to debundle it into dist/. (CI will, as part of running tests, debundle all the bundles in that folder.)
  • Make sure any contribution pass the tests: npm test

Legal note

Some companies specify in their terms of service that their code cannot be "reverse engineered". Debundling can definitely (depending on how you're using the code) fall under that umbrella. Understand what you are doing so you don't break any agreements ๐Ÿ˜„

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].