youdie323323/enigma: The first publicly available better javascript virtual machine obfuscator

Klenance
2 Min Read


license

🚀 The first publicly available better javascript virtual machine obfuscator

This tool allows you to run JavaScript code on a custom-built JavaScript interpreter, effectively making reverse engineering harder.
In a nutshell, i called this as javascript version of webassembly.

🔒 Obfuscation that truly hides your code

  • Eliminates variable names
  • Hides structural differences in loops
  • Obscures labels
  • And much more…

🛡️ Virtually irreversible

  • The compiled output is extremely difficult to restore to its original form.

JavaScript enigma VM obfuscates your code by compiling it into a custom bytecode format that runs on an embedded virtual machine.

Unlike traditional obfuscators like obfuscator.io or js-confuser, Enigma analyzes the AST (Abstract Syntax Tree) and converts everything into bytecode before running it on a VM. To reverse this, one would need to create a disassembler, which is no trivial task.

Moreover, deobfuscating the original code from the disassembled output is extremely challenging. Most disassemblers display the code in an assembly-like format. This means that if the code is pre-obfuscated and then executed on the Enigma VM, the difficulty of reverse engineering increases significantly.

import { Compiler, ProgramBuilder } from "enigma-vm";

(async function () {
  const compiler = new Compiler();

  const input = `
        function sayHello(name) {
            console.log("Hello,", name + "!");
        }

        for (let i = 0; i < 3; i++) {
            sayHello("Me and " + i);
        }
    `;

  compiler.compile(input);

  const bytecode = compiler.constructBytecode();
  const code = await new ProgramBuilder().build(bytecode);

  console.log(code);
})();

Check out the examples folder for sample compiled code!

This enigma virtual machine is a recreation of KASADA’s virtual machine.

If you encounter any issues, please open an issue!

A huge thank you to:

This project is licensed under the MIT License.

Source link

Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *