Javascript模糊处理算法
我试图理解模糊处理算法,我看到了这些代码。例如,真正的代码是Javascript模糊处理算法,javascript,arrays,algorithm,obfuscation,deobfuscation,Javascript,Arrays,Algorithm,Obfuscation,Deobfuscation,我试图理解模糊处理算法,我看到了这些代码。例如,真正的代码是 <p>ABC</p> ABC 编码版本为以下代码 var erp = new Array; erp[0] = 1013988929; erp[1] = 1111702575; erp[2] = 28734; var em = ''; for(i=0;i<erp.length;i++){ tmp = erp[i]; if(Math.floor((tmp/Math.pow(256,3)))
<p>ABC</p>
ABC
编码版本为以下代码
var erp = new Array;
erp[0] = 1013988929;
erp[1] = 1111702575;
erp[2] = 28734;
var em = '';
for(i=0;i<erp.length;i++){
tmp = erp[i];
if(Math.floor((tmp/Math.pow(256,3)))>0){
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,3))));
};
tmp = tmp - (Math.floor((tmp/Math.pow(256,3))) * Math.pow(256,3));
if(Math.floor((tmp/Math.pow(256,2)))>0){
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,2))));
};
tmp = tmp - (Math.floor((tmp/Math.pow(256,2))) * Math.pow(256,2));
if(Math.floor((tmp/Math.pow(256,1)))>0){
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,1))));
};
tmp = tmp - (Math.floor((tmp/Math.pow(256,1))) * Math.pow(256,1));
if(Math.floor((tmp/Math.pow(256,0)))>0){
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,0))));
};
};
document.write(em);
var-erp=新数组;
erp[0]=1013988929;
erp[1]=1111702575;
erp[2]=28734;
var em=“”;
对于(i=0;i0){
em+=String.fromCharCode(Math.floor((tmp/Math.pow(256,3));
};
tmp=tmp-(数学层((tmp/Math.pow(256,3)))*Math.pow(256,3));
如果(数学层((tmp/Math.pow(256,2)))>0){
em+=String.fromCharCode(Math.floor((tmp/Math.pow(256,2));
};
tmp=tmp-(数学层((tmp/Math.pow(256,2)))*Math.pow(256,2));
如果(数学层((tmp/Math.pow(256,1))大于0){
em+=String.fromCharCode(Math.floor((tmp/Math.pow(256,1));
};
tmp=tmp-(数学层((tmp/Math.pow(256,1)))*Math.pow(256,1));
如果(数学层((tmp/Math.pow(256,0)))>0){
em+=String.fromCharCode(Math.floor((tmp/Math.pow(256,0));
};
};
文件编写(em);
这段代码是如何工作的?我把“erp”数组的值改为65,它的意思是“A”,然后它就工作了。它的所有时间工作正常字符代码。但是这个脚本如何识别“1111702575”值呢?如何为该算法创建模糊处理。总的来说,这是一个非常简单的转换,将
32位整数(4字节)转换为4个1字节字符,这些字符串接在em
变量中
首先,您可以注意到字符串A
、BC
和codep>
分别是整数1013988929
、1111702575
和28734
(第三个字符串仅包含2个符号,因此第三个整数小于2^16
)
for
循环中的代码表示将一个整数转换为4个符号的解密算法
if
s检查数字中是否有足够的位从中提取符号。例如,第三个sting(p>
只有2个符号,第三个整数28734
表示它们)。请注意以下检查:
if(Math.floor((tmp/Math.pow(256,3)))>0)
if(Math.floor((tmp/Math.pow(256,2)))>0)
if(Math.floor((tmp/Math.pow(256,1)))>0)
if(Math.floor((tmp/Math.pow(256,0)))>0)
字符串连接:
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,3))));
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,2))));
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,1))));
em += String.fromCharCode(Math.floor((tmp/Math.pow(256,0))));
只需从整数中提取一个符号。将一个字节(256位)转换为ASCII表中的256个符号之一