Skip to content

obfuscator: 处理variableDeclaration时语句顺序错误导致变量定义前被访问 #114

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

Closed
djc-Sherlock opened this issue Aug 21, 2024 · 3 comments

Comments

@djc-Sherlock
Copy link

Which plugin are you reporting a bug for?

obfuscator

Version of Node

v18.16.0

Input code

https://playcode.io/1977912
这个用obfuscator的解密成功后,运行脚本不成功。
会报错
Cannot set properties of undefined (setting 'lib')
TypeError: Cannot set properties of undefined (setting 'lib')
可以帮忙看看是否是解密的问题嘛

Additional context

No response

@echo094
Copy link
Owner

echo094 commented Aug 21, 2024

你这个原始脚本也不能运行啊

@djc-Sherlock
Copy link
Author

你这个原始脚本也不能运行啊
完整脚本已更新 https://playcode.io/1977912
麻烦看下

@echo094 echo094 changed the title [Bug]: 解密后无法正常运行 obfuscator: 处理variableDeclaration时语句顺序错误导致变量定义前被访问 Aug 21, 2024
@echo094
Copy link
Owner

echo094 commented Aug 21, 2024

问题找到了,在处理如下所示的代码时:

var a8 = {}, a9 = a8.lib = {}

语句转换成了:

a8.lib = {}
var a8 = {}
var a9 = a8

导致a8在定义前就被访问了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants