Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscated code fails to work in IE8 #22

Closed
Wain-PC opened this issue Nov 21, 2016 · 21 comments
Closed

Obfuscated code fails to work in IE8 #22

Wain-PC opened this issue Nov 21, 2016 · 21 comments

Comments

@Wain-PC
Copy link

Wain-PC commented Nov 21, 2016

Hello! I know IE8 is a little bit outdated, but still =)
Running the obfuscated script on IE8 outputs the following error:
'filter' is null or not an object

I assume this is caused by this JSFuck line, as Array.filter support started from IE9:
Window: '[]["filter"]["constructor"]("return this")()',

If this is the case, it should probably be safe to change this for a more supported method, such as push:
Window: '[]["push"]["constructor"]("return this")()',

@sanex3339
Copy link
Member

what version you use?

@Wain-PC
Copy link
Author

Wain-PC commented Nov 21, 2016

I've used 0.8.0. Should it help to update to 0.8.1?

@sanex3339
Copy link
Member

sanex3339 commented Nov 21, 2016

Only one place where []["filter"]["constructor"]("return this")() still using is following line (looks like i forgot to change this line):
https://github.com/javascript-obfuscator/javascript-obfuscator/blob/master/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts#L13

I will replace this line today on {}.constructor('debugger')()

@Wain-PC
Copy link
Author

Wain-PC commented Nov 21, 2016

Thanks! I see that this line is intended to be used with debug protection mode. However, my script has been built without debugProtection flag set to true (actually, without this flag at all, but readme says its default value is false). Is this a desired behavior?

@sanex3339
Copy link
Member

sanex3339 commented Nov 21, 2016

maybe it is line here https://github.com/javascript-obfuscator/javascript-obfuscator/blob/0514793257b306d38b0936ec16031818b5e783c7/src/enums/JSFuck.ts
but i tested code before 0.8.0 release on ie9 in ie8 compatibility mode and it doesnt't throw any errors.

Anyway i change this lines today and i hope it helps for you.

@Wain-PC
Copy link
Author

Wain-PC commented Nov 21, 2016

Thanks again! One more issue: disableConsoleOutput option works not as expected:
With value set to true, console.log function is replaced with the following one:
image
This obviously hangs the page with an infinite loop, and surely this is not an expected behavior (this option is turned on by default!)
This also affects other console methods, such as warn, info and error.

@sanex3339
Copy link
Member

sanex3339 commented Nov 21, 2016

One more issue: disableConsoleOutput option works not as expected

already fixed in 0.8.1. In 0.8.1 infinity loop replaced on just empty functions

@Wain-PC
Copy link
Author

Wain-PC commented Nov 21, 2016

That's correct, I was using an outdated dependency, my fault.
I'll close the issue for now, hope your fixes will resolve the initial problem.

@Wain-PC Wain-PC closed this as completed Nov 21, 2016
@sanex3339 sanex3339 reopened this Nov 21, 2016
@sanex3339
Copy link
Member

reopen until fix

@sanex3339
Copy link
Member

Ready in javascript-obfuscator@0.8.2

Please try and check.

@Wain-PC
Copy link
Author

Wain-PC commented Nov 23, 2016

Thanks, I will perform heavier autotesting on it next week. For now, I've performed several manual builds and they seem to work in IE8.

@sanex3339
Copy link
Member

Nice!

@sanex3339
Copy link
Member

any test results?

@qingweiqm
Copy link

qingweiqm commented Dec 27, 2016

@sanex3339 hi,I'm using the webpage to do the obfuscate, the obfuscated code doesn't work in IE8.

@sanex3339
Copy link
Member

sanex3339 commented Dec 27, 2016

Hi, show me your obfuscator options and if possible obfuscated code please.
Does the code without obfuscation work in IE8?

@sanex3339
Copy link
Member

i will look into it

@sanex3339
Copy link
Member

sanex3339 commented Dec 27, 2016

I haven't any runtime errors. How the code should work? Did you have runtime errors on IE8?

If you doesn't have any expected output to the console - set disableConsoleOutput to false. disableConsoleOutput disable console.log, console.error, console.warn and console.info output to the console.

@qingweiqm
Copy link

thanks, after disable the consoleoutput, it works.

@sanex3339
Copy link
Member

Nice!

@sanex3339
Copy link
Member

sanex3339 commented Dec 27, 2016

So, i will close this issue. If you will find any problems with ie8 - just create new issue.

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants