Giter VIP home page Giter VIP logo

detaped's Introduction

Detaped

Introduction

Detaped is a Python disassembler and decompiler for Duktape (GitHub). The intended use is for source code review and analysis in situations where you only have the compiled Duktape bytecode binary, such as in a black-box assessment.

Features

  • Parses JSE file format
  • Disassemble JSE binary, or directory of binaries
  • Produces ASM style instructions (one-to-one bytecode mapping)
  • Produces low-level JavaScript "like" output
  • Decompiler produces basic high-level JavaScript "like" output

Supported Versions

  • v2.7.0

Usage

└─$ detaped --help                                           
usage: detaped.py [-h] [-o OUTPUT] [-a ASM] [-t TXT] [-n] [-v {none,normal,debug}]
                  [--disable-grouping] [--disable-call] [--disable-jump] [--disable-if-else]
                  [--disable-if-condition] [--disable-try-catch-finally] [--disable-for-loop]
                  [--disable-while-loop] [--disable-init-array] [--disable-init-object]
                  [--disable-get-prop] [--disable-join-operator] [--disable-double-return]
                  input

Duktape JavaScript bytecode decompiler

positional arguments:
  input                 The Duktape bytecode file or directory to be decompiled.

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        The decompiled output JavaScript file or directory.
  -a ASM, --asm ASM     The output JavaScript ASM file or directory.
  -t TXT, --txt TXT     The command output text file.
  -n, --no-ansi         Disable ANSI color output.
  -v {none,normal,debug}, --verbosity {none,normal,debug}
                        The script output verbosity mode. (Default "normal")

Decompiler Grouping:
  Disable specific decompiler grouping functionality.

  --disable-grouping    Disables all grouping functionality.
  --disable-call        Disables call grouping.
  --disable-jump        Disables jump block grouping.
  --disable-if-else     Disables if/else block grouping.
  --disable-if-condition
                        Disables grouping if statement with preceding condition.
  --disable-try-catch-finally
                        Disables try/catch/finally block grouping.
  --disable-for-loop    Disables for loop block grouping.
  --disable-while-loop  Disables while loop block grouping.
  --disable-init-array  Disables grouping array initialization.
  --disable-init-object
                        Disables grouping object initialization properties.
  --disable-get-prop    Disables grouping get properties.
  --disable-join-operator
                        Disables grouping join operators.
  --disable-double-return
                        Disables grouping return undefined after return.

Process

The following diagram shows how a simple JavaScript file is transformed into the various states.

  1. Compilation - The original file is compiled using Duktape into bytecode.
  2. Parser - The bytecode file structure is parsed using Detaped.
  3. Disassembler - The parsed bytecode is disassembled into an ASM like file.
  4. Decompiler - The disassembled data is decompiled to a JavaScript like file.
  5. Grouping - Common decompiled patterns are grouped to a higher-level JavaScript like file.

Process

detaped's People

Contributors

mccaulay avatar mccaulayncc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.