MichaelXF / js-confuser

JS-Confuser is a JavaScript obfuscation tool to make your programs *impossible* to read.
https://js-confuser.com
MIT License
168 stars 28 forks source link

Control Flow Flattening breaks nested redefined function declaration #85

Open MichaelXF opened 1 year ago

MichaelXF commented 1 year ago

Config and Small code sample

Config:

{
  target: "node",
  controlFlowFlattening: true
}

Code:

if (true) {
  function myFunction() {
    console.log("Top Function Declaration");
  }

  function myFunction() {
    console.log("Bottom Function Declaration");
  }
}

var filler;

myFunction(); // "Bottom Function Declaration"

Expected behavior

The program should output "Bottom Function Declaration"

Actual behavior

The program outputs "Top Function Declaration"