2

I am looking for a JavaScript obfuscator tool that doesn't use eval in resulted obfuscated code.

All the tools I've seen so far use eval in resulted code.

JasCav
  • 34,458
  • 20
  • 113
  • 170
Arshdeep
  • 4,281
  • 7
  • 31
  • 46
  • 2
    Can I ask why you want to do this ? – Chris Aug 25 '10 at 15:34
  • i want to use code in adobe air. and it dont allow you to use eval – Arshdeep Aug 25 '10 at 16:20
  • 2
    How about replacing `eval(...)` with `Function(...)()`? They are slightly different in behavior, but that might not matter here. – kangax Aug 25 '10 at 16:26
  • @kangax i had thought of this already .But i doubt this solution as this way the scope of variable will not be global – Arshdeep Aug 25 '10 at 17:02
  • well, `eval` doesn't evaluate code in global scope either, but in the scope of a caller (unless it's an indirect eval call or eval is called from within global scope). You can use `Function()()` and create global variables in such way so that it would work when evaluated from any scope, e.g.: instead of `Function('var myGlobalVar = ...')()` use `Function('this.myGlobalVar = ...')()` – kangax Aug 26 '10 at 10:22

1 Answers1

0

None. An obfuscator by definition needs to have a way to execute arbitrary code, and in JavaScript, that is accomplished with eval.

Jacob Relkin
  • 161,348
  • 33
  • 346
  • 320