ben-sb / javascript-deobfuscator

General purpose JavaScript deobfuscator
https://deobfuscate.io
Apache License 2.0
747 stars 106 forks source link

proxyRemover: visiting a proxy function should use the function scope #35

Closed bvanheu closed 1 year ago

bvanheu commented 2 years ago

This avoid infinite loop when a symbol is redefined in the function's scope.

For example, the following should not result in infinite loop:

function f1(a,b) {
  return function (c,d) {
    function redefined(e,f){return e+f;}
    function f3(g, h){return redefined(g,h);}
    return function(i,j) {
      function redefined(k, l) {
        return f3(k, l);
      }
      return redefined(i,j)
    }(c,d);
  }(a,b);
};
console.log(f1(1,2));
ben-sb commented 1 year ago

Sorry for not getting to this for so long, thanks for contributing