js-confuser icon indicating copy to clipboard operation
js-confuser copied to clipboard

Rename Variables breaks with statement

Open MichaelXF opened this issue 1 year ago • 5 comments

Config and Small code sample

Config:

{
  target: "node",
  renameVariables: true
}

Code:

var a = "Incorrect value";
with ({ a: "Correct Value" }) {
  console.log(a);
}

// "Correct Value"

Obfuscated Code:

var Tru_whk = "Incorrect value";
with ({ ["a"]: "Correct Value" }) {
  console["log"](Tru_whk);
}

// "Incorrect value"

Additional context

Might be easiest to disable renaming fully in with statements or not support it entirely. Since any object can be passed in, theres no way for the obfuscator to know if the name will be shadowed or not.

MichaelXF avatar Aug 11 '24 17:08 MichaelXF