javascript-obfuscator: Broken After 0.24

After updating the lib, there’s a chance that the String Array does not work correctly.

I tested below code in obfuscator.io

rows.forEach((row, index) => {
  if (o.val) fn(` CONTENT ${o.val}`)
})
  • String Array
    • Rotate
    • Shuffle
    • Base64 Encoding
    • Threshold - 0.5
  • Split String Chunk: 15

The above will generate (result differs for each run):

rows['forEach']((c, d) => {
    if (o[b('0x0')])
        fn('\x20CONTENT\x20' + o['val']);
});
rows['forEach']((c, d) => {
    if (o[b('0x1')])
        fn(b('0x0') + o['val']);
});
rows['forEach']((c, d) => {
    if (o['val'])
        fn(b('0x1') + o[b('0x0')]);
});

I was expecting the code to be below instead.

    if (o[b('0x0')])
        fn(b('0x1') + o[b('0x0')]);

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (14 by maintainers)

Most upvoted comments

Yes. Just tested and it looks good so far. Thanks for the quick fixes!

Finally, found the issue here:

function run(aaa, { missing = '' } = {}) {
    let q = `run ${aaa} `;
    if (missing)
        q += ` SOMETHING ${missing}`;
    return q;
}

console.log(run('dummy', { missing: 'IMPORTANT' }))

The { missing } is renamed but the outside calling function is still using the same signature.