ben-sb / obfuscator-io-deobfuscator

A deobfuscator for scripts obfuscated by Obfuscator.io
https://obf-io.deobfuscate.io
Apache License 2.0
275 stars 61 forks source link

bug: StringRevealer replace mutable property by default value #5

Closed ultranity closed 10 months ago

ultranity commented 10 months ago

module StringRevealer

object default value should not be replaced globally if it

example:

a = {
1: ""
}
a[1] = 2

let b = a[1]

current transform result:

let b = “”

expected: check if property is mutable(?) and skip StringRevealer for them

ben-sb commented 10 months ago

Unfortunately there isn't a good way to tell with 100% certainty if a property is mutated (as property keys can be generated at runtime e.g. it is unclear which property is being accessed in a[someFunction()]).

What you can do is detect when the overall object is modified, and not replace anything in that case. This is available by setting config.objectSimplification.unsafeReplace to false).

ultranity commented 10 months ago

thanks for your explaination~