MichaelXF / js-confuser

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

Rename Variables breaks with statement #137

Open MichaelXF opened 2 months ago

MichaelXF commented 2 months ago

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.

Mrgaton commented 2 weeks ago

But then sadly you have a bunch of __p_7812057763_flat___p_1597929504_dLR_4__JS_PREDICT____JS_PREDICT__

Mrgaton commented 1 week ago

@MichaelXF At leat can you make only rename confuser generated variables and only pre mangle my code