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

a bug here #3

Closed dmhai closed 10 months ago

dmhai commented 10 months ago

========= input code ========= var obConfig = { greaterThan: function (n, t) { return n > t; }, greaterThan_2: function (n, t) { return t < n; //also greater than function, just Swap parameter position }, };

function testFunc() { var num = "".length; if (obConfig.greaterThan(num, 5)) { console.log(">5"); }
if (obConfig.greaterThan_2(num, 5)) { console.log(">5"); }
}

========= deobfuscator result ========= function testFunc() { var num = "".length; if (num > 5) { console.log(">5"); } if (5 < num) { <<== Deobfuscate error here, it should be : num > 5 console.log(">5"); } }

ben-sb commented 10 months ago

5 < num looks correct to me in this case (it is syntactically equivalent to num > 5, and is also the order in which the greaterThan_2 function actually evaluates the condition)

dmhai commented 10 months ago

it's my fault, and thanks for answer.