/Deobfuscate

Obfuscated JS  🠖  More readable

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

Deobfuscate

Make obfuscated JavaScript code more readable.



Status

Currently the deobfuscation doesn't prioritize one step
over another, however this will change in the future.



Steps

Implemented deobfuscation steps.


  • Combined Expressions

    expression && expression
    if(expression)
        expression

  • Double Knot

    !! expression
    Boolean(expression)

  • Interjoined Assignments

    (a = {}).b = 1
    a = {} ;
    b = 1 ;

  • Joined Variables

    let a = 1 ,
        b = 2 ;
    let a = 1 ;
    let b = 2 ;

  • Literal Garbage

    0;

  • Non-constant

    var a = 1;
    const a = 1;

  • Noop

    ;

  • Number Logic

    !0 !1
    true false

  • Property Twins

    const object = {
        property : property
    }
    const object = {
        property
    }

  • Readable Variables

    const a;
    const __thing_234

  • Secondhand Call

    (method)(a,b,c)
    method(a,b,c)

  • Sequenced Expressions

    ( expression , expression )
    expression;
    expression;

  • Sequence Literals

    (0,a,0,b,0)
    (a,b,0)

  • Stringed Indexing

    object['key']
    object.key

  • Twin Declaration

    const w = window;

  • Unreachable Conditions

    if(false)
        ;

  • Useless Constants

    const a;

  • Void Literal

    void 0
    undefined