mindedsecurity / JStillery

Advanced JavaScript Deobfuscation via Partial Evaluation
GNU General Public License v3.0
864 stars 144 forks source link

Stringifying functions #31

Open DayDun opened 5 years ago

DayDun commented 5 years ago

Converting a function to a string can give different results depending on which environment is running the code.

"" + console.log

gives

"function () { [native code] }"

in JStillery while in chrome it gives

"function log() { [native code] }"

and in firefox

"function log() {\n    [native code]\n}"

"" + function() {/* Hello world */}

should also return

"function() {/* Hello world */}"

instead of

"function () {\n}"

like it does right now.

I think it would be great if options were added to JStillery where you could specify which environment should be emulated, where you could choose a browser for example.