// 正常形态 function test(a){ var b = a; b += 1; b += 2; b += 3; b += 4; return a + b }
// 乱序形态 //(这里比较简单,在很多加密网站上case 后面往往不是数字或字符串,而是类似 YFp[15][45][4]这样的对象,相当恶心) function test1(a){ var arr = [1,2,3,4,5,6] for(var i = 0, i < arr.lenght, i++){ switch (arr[i]) { case 4: b += 3; break; case 2: b += 1; break; case 1: var b = a; break; case 3: b += 2; break; case 6: return a + b case 5: b += 4; break; } } } // 结果都是30 但是test1看着费劲 console.log(test1(10)); console.log(test(10));
压缩代码
把多行代码压缩成一行
1 2 3 4 5 6 7 8 9 10 11 12 13 14
function test(a){ var b = a; var c = b + 1; var d = b + 2; var e = b + 3; var f = b + 4; return e + f } // 压缩一下 function test1(a){ var b,c,d,e,f return f = (e = (d = ( c = (b = a,b + 1),b + 2),b + 3),b + 4),e + f }