Skip to content

Instantly share code, notes, and snippets.

@freundTech
Last active January 24, 2020 22:21
Show Gist options
  • Save freundTech/7cbb095ffca731a4aea1 to your computer and use it in GitHub Desktop.
Save freundTech/7cbb095ffca731a4aea1 to your computer and use it in GitHub Desktop.
Possibly the worst JavaScript ever written
this[([]+!![])[!![]+!![]+!![]]+"v"+([]+![])[![]+!![]]+([]+![])[!![]+!![]]](([]+![])[![]+![]]+([]+[][[]])[![]+![]]+([]+[][[]])[![]+!![]]+([]+typeof([]))[!![]+!![]+!![]+!![]]+([]+!![])[![]+![]]+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+[][[]])[![]+!![]]+" "+([]+![])[![]+!![]]+([]+!![])[![]+!![]]+([]+!![])[![]+!![]]+([]+![])[![]+!![]]+"y"+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+![])[![]+![]]+"y"+"("+([]+!![])[![]+![]]+")"+"{"+"v"+([]+![])[![]+!![]]+([]+!![])[![]+!![]]+" "+([]+typeof([]))[![]+![]]+"="+"{"+([]+![])[![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"["+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+(typeof(![]))[![]+![]]+":"+"\""+"("+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"!"+"["+"]"+")"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+([]+typeof([]))[!![]+!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"["+"]"+")"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+[][[]])[!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"["+"]"+"["+"["+"]"+"]"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+!![])[!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"!"+"["+"]"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+![])[![]+![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"["+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+([]+typeof([]+[[]]))[!![]+!![]+!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"["+"]"+"+"+"["+"["+"]"+"]"+")"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+"h"+":"+"\'"+"\""+"h"+"\""+"\'"+","+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"["+"]"+"["+"["+"]"+"]"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+typeof([]))[!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"["+"]"+")"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+"k"+":"+"\'"+"\""+"k"+"\""+"\'"+","+([]+![])[!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"["+"]"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+typeof(![]+![]))[!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"!"+"["+"]"+"+"+"!"+"["+"]"+")"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+[][[]])[![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"["+"]"+"["+"["+"]"+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+typeof([]))[![]+![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"["+"]"+")"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+"p"+":"+"\'"+"\""+"p"+"\""+"\'"+","+"q"+":"+"\'"+"\""+"q"+"\""+"\'"+","+([]+!![])[![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"!"+"["+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+![])[!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"["+"]"+")"+"["+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+([]+!![])[![]+![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"!"+"["+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+([]+[][[]])[![]+![]]+":"+"\""+"("+"["+"]"+"+"+"["+"]"+"["+"["+"]"+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+"v"+":"+"\'"+"\""+"v"+"\""+"\'"+","+"w"+":"+"\'"+"\""+"w"+"\""+"\'"+","+"x"+":"+"\'"+"\""+"x"+"\""+"\'"+","+"y"+":"+"\'"+"\""+"y"+"\""+"\'"+","+"z"+":"+"\'"+"\""+"z"+"\""+"\'"+","+"\'"+"\""+"\'"+":"+"\'"+"\""+"\""+"\""+"\'"+"}"+";"+([]+typeof([]))[![]+![]]+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"p"+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"="+"["+"]"+";"+([]+![])[![]+![]]+([]+typeof([]))[![]+![]]+([]+!![])[![]+!![]]+"("+"v"+([]+![])[![]+!![]]+([]+!![])[![]+!![]]+" "+"p"+" "+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+[][[]])[![]+!![]]+" "+([]+!![])[![]+![]]+")"+([]+typeof([]))[![]+![]]+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"p"+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"."+"p"+([]+[][[]])[![]+![]]+([]+![])[!![]+!![]+!![]]+"h"+"("+([]+!![])[![]+![]]+"["+"p"+"]"+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+[][[]])[![]+!![]]+" "+([]+typeof([]))[![]+![]]+"?"+([]+typeof([]))[![]+![]]+"["+([]+!![])[![]+![]]+"["+"p"+"]"+"]"+":"+"\'"+"\""+"\'"+"+"+([]+!![])[![]+![]]+"["+"p"+"]"+"+"+"\'"+"\""+"\'"+")"+";"+([]+!![])[![]+!![]]+([]+!![])[!![]+!![]+!![]]+([]+!![])[![]+![]]+([]+[][[]])[![]+![]]+([]+!![])[![]+!![]]+([]+[][[]])[![]+!![]]+" "+([]+typeof([]))[![]+![]]+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"p"+([]+[][[]])[![]+![]]+([]+!![])[![]+![]]+"."+([]+typeof([]))[!![]+!![]]+([]+typeof([]))[![]+![]]+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+[][[]])[![]+!![]]+"("+"\""+"+"+"\""+")"+"}")
@dcjohnson
Copy link

Piece of crap doesn't work.

PS E:\Development\7cbb095ffca731a4aea1> node .\js-horror.js
E:\Development\7cbb095ffca731a4aea1\js-horror.js:1
[]+!![])[!![]+!![]+!![]]+"v"+([]+![])[![]+!![]]+([]+![])[!![]+!![]]](([]+![])[
^
TypeError: undefined is not a function
at Object. (E:\Development\7cbb095ffca731a4aea1\js-horror.js:1:137)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

@1lann
Copy link

1lann commented Sep 3, 2015

@jcjohnson You're using it wrong. It will load a function called "arrayify". For example: evaluate the code in your console, then you can do arrayify("string").

Decoded (and prettified by hand) source code:

this["eval"](
    function arrayify(t) {
        var o = {
            a: "([]+![])[![]+!![]]",
            b: "(typeof(![]))[![]+![]]",
            c: "([]+typeof([]))[!![]+!![]+!![]+!![]]",
            d: "([]+[][[]])[!![]+!![]]",
            e: "([]+!![])[!![]+!![]+!![]]",
            f: "([]+![])[![]+![]]",
            g: "([]+typeof([]+[[]]))[!![]+!![]+!![]+!![]+!![]]",
            h: '"h"',
            i: "([]+[][[]])[!![]+!![]+!![]+!![]+!![]]",
            j: "([]+typeof([]))[!![]+!![]]",
            k: '"k"',
            l: "([]+![])[!![]+!![]]",
            m: "([]+typeof(![]+![]))[!![]+!![]]",
            n: "([]+[][[]])[![]+!![]]",
            o: "([]+typeof([]))[![]+![]]",
            p: '"p"',
            q: '"q"',
            r: "([]+!![])[![]+!![]]",
            s: "([]+![])[!![]+!![]+!![]]",
            t: "([]+!![])[![]+![]]",
            u: "([]+[][[]])[![]+![]]",
            v: '"v"',
            w: '"w"',
            x: '"x"',
            y: '"y"',
            z: '"z"',
            '"': '"""'
        };

        output = [];

        for (var p in t) {
            output.push(t[p] in o ? o[t[p]]:'"' + t[p] + '"');
        }

        return output.join("+");
    }
)

@bturner1273
Copy link

REPORTED FOR ABUSE! (jkjk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment