首页 >php教程 >PHP源码 >php混淆加密

php混淆加密

PHP中文网
PHP中文网原创
2016-05-26 08:20:012200浏览

1.php代码

<?php
 $O00OO0=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$O00O0O=$O00OO0{3}.$O00OO0{6}.$O00OO0{33}.$O00OO0{30};$O0OO00=$O00OO0{33}.$O00OO0{10}.$O00OO0{24}.$O00OO0{10}.$O00OO0{24};$OO0O00=$O0OO00{0}.$O00OO0{18}.$O00OO0{3}.$O0OO00{0}.$O0OO00{1}.$O00OO0{24};$OO0000=$O00OO0{7}.$O00OO0{13};$O00O0O.=$O00OO0{22}.$O00OO0{36}.$O00OO0{29}.$O00OO0{26}.$O00OO0{30}.$O00OO0{32}.$O00OO0{35}.$O00OO0{26}.$O00OO0{30};eval($O00O0O("JE8wTzAwMD0iZGVLeExXYnFBTmNHbXBJSFJrU2hzRWlaSm5RRnZYb3lhck11VVlPQkNqVmx3RGd0VGZ6UG1QemhPa0RmVHdSdm9NanljSlVTWUtYZW5RdGRzTnVJcGFnckxCVkdBSFdFYlpsQ3FGeGlpWjlicHlUd0FRd0VSM3dNRDI1RlIzY1NSUXRsekFKN1p0TUpla2VNRG9MbHpBVFFVTDVGdFdMUU9BRzBSUVdFakFKN1p0TU1Eb3dZbWtjRU4yOXJCMkxsekFtSEQyNW9wa1JzQm9keGVVNWJweVRRenFZd0FIOCtadHV3QUhiL1J2U2JadHV3QVg4c1lQcUdzN2FpWWZqd0FvRW9qQVNNUjN3RW1BVHVqQWNGYzBXTGpkWVFCMmRzbjEwbHpVSmxQYjB6QVVjYlJvZENqWjBsbmQ5eWNXdGxrSW1IQms4UU5xWXdBUTBsZWtoeGVrRW9qQVNNUjN3RW1BVHVqQWNGYzBXTGpkWVFSeW5TRFVtbWpBSk1qeVl3QWxKSlJ5blNEVVQ5akFjRmMwV0xqZFlRUnluU0RVbW1WYjB6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MDAwMCwkT08wMDAwKSwkT08wTzAwKCRPME8wMDAsMCwkT08wMDAwKSkpKTs="));
  ?>

2.php代码

function unscrambler($code) {
  if(! is_array($code)) {
    $code = str_replace(&#39;__FILE__&#39;, "&#39;$code&#39;", str_replace(&#39;eval&#39;, &#39;$code=&#39;, file_get_contents($code)));
    eval(&#39;?>&#39; . $code);
  }else {
    extract($code);
    $code = str_replace("eval", &#39;$code=&#39;, $code);
    eval($code);
  }
  if(strstr($code, &#39;eval&#39;)) return unscrambler(get_defined_vars());
  else return $code;
}
  
echo unscrambler(&#39;需要还原的代码或文件名&#39;);

3.php代码

<?php
  function RandAbc($length=""){ //返回随机字符串
    $str="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    return str_shuffle($str);
  }
 $filepath=&#39;index.php&#39;;
 $path_parts= pathinfo($filepath);
 $filename=$path_parts["basename"];
 
 $T_k1=RandAbc();//随机密匙1
 
 $T_k2=RandAbc();//随机密匙2
  
 $vstr=file_get_contents($filename);//要加密的文件
  
 $v1=base64_encode($vstr);
 $c=strtr($v1,$T_k1,$T_k2);//根据密匙替换对应字符。
 
 $c=$T_k1.$T_k2.$c;
 
 $q1="O00O0O";
 $q2="O0O000";
 $q3="O0OO00";
 $q4="OO0O00";
 $q5="OO0000";
 $q6="O00OO0";
 $s=&#39;$&#39;.$q6.&#39;=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$&#39;.$q1.&#39;=$&#39;.$q6.&#39;{3}.$&#39;.$q6.&#39;{6}.$&#39;.$q6.&#39;{33}.$&#39;.$q6.&#39;{30};$&#39;.$q3.&#39;=$&#39;.$q6.&#39;{33}.$&#39;.$q6.&#39;{10}.$&#39;.$q6.&#39;{24}.$&#39;.$q6.&#39;{10}.$&#39;.$q6.&#39;{24};$&#39;.$q4.&#39;=$&#39;.$q3.&#39;{0}.$&#39;.$q6.&#39;{18}.$&#39;.$q6.&#39;{3}.$&#39;.$q3.&#39;{0}.$&#39;.$q3.
&#39;{1}.$&#39;.$q6.&#39;{24};$&#39;.$q5.&#39;=$&#39;.$q6.&#39;{7}.$&#39;.$q6.&#39;{13};$&#39;.$q1.&#39;.=$&#39;.$q6.&#39;{22}.$&#39;.$q6.&#39;{36}.$&#39;.$q6.&#39;{29}.$&#39;.$q6.&#39;{26}.$&#39;.$q6.&#39;{30}.$&#39;.$q6.&#39;{32}.$&#39;.$q6.&#39;{35}.$&#39;.$q6.&#39;{26}.$&#39;.$q6.&#39;{30};eval($&#39;.$q1.&#39;("&#39;.base64_encode(&#39;$&#39;.$q2.&#39;="&#39;.$c.&#39;";eval(\&#39;?>\&#39;.$&#39;.$q1.&#39;($&#39;.$q3.&#39;($&#39;.$q4.&#39;($&#39;.$q2.&#39;,$&#39;.$q5.&#39;*2),$&#39;.$q4.&#39;($&#39;.$q2.&#39;,$&#39;.$q5.&#39;,$&#39;.$q5.&#39;),$&#39;.$q4.&#39;($&#39;.$q2.&#39;,0,$&#39;.$q5.&#39;))));&#39;).&#39;"));&#39;;
  
 $s=&#39;<?
 &#39;.$s.
&#39;
?>&#39;;
  
echo $s;
//生成 加密后的php文件
!is_dir(&#39;create/&#39;) && mkdir(&#39;create/&#39;);
$fpp1 = fopen(&#39;create/&#39;.$filename,&#39;w&#39;);
fwrite($fpp1,$s) or die(&#39;写文件错误&#39;);
echo &#39;加密成功!&#39;;
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn