mindedsecurity / JStillery

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

enhancement: IfStatement expressions has mutil #24

Open weituotian opened 5 years ago

weituotian commented 5 years ago

great repo! and i have some suggest to improve it!

one user case:

var a = Math.ramdom();
var b = Math.ramdom();
if (a = a + 0.2, b = b + 0.1, a > b) {
    console.log('haha');
}

i want it to

var a = Math.ramdom();
var b = Math.ramdom();
a = a + 0.2;
b = b + 0.1;
if (a > b) {
    console.log('haha');
}

does it easy to do it?

weituotian commented 5 years ago

it may hard to do it, if it can return an express statement and an ifStament, it would be easy more!

weituotian commented 5 years ago

@wisec give you a tip: it is better to solve the problem about ast_reduce_scoped to handle return an arr