$file = 'plugin.php'; //要破解的文件
$fp = fopen($file, 'r');
$str = fread($fp, filesize($file));
fclose($fp);
copy($file, '0_'.$file);
$n = 1;
while($n 0){
$code = str_replace('eval(', $replace.'(', $code);
}else{
preg_match("/@\$(.*)(\$(.*),(.*)(/isU", $code, $res);
$code = str_replace($res[3], "'$replace", $code);
}
$code = preg_replace('/\$(.*)=false;(.*?)();/', '', $code); //上一版本
$code = preg_replace('/||@\$(.*?)();/', '|| print("ok");', $code);
$code = destr($code);
$tmp_file = 'detmp'.$n.'.php';
file_put_contents($tmp_file, $code);
include($tmp_file);
$val = 'decode'.$n;
$str = $$val;
unlink($tmp_file);
if(strpos($str, ';?>') === 0){
$decode = $str;
break;
}
$str = " $n++;
}
$decode = preg_replace("/^(.*)exit('Access Denied'); /", " $del = strrchr($decode, 'unset');
$decode = str_replace($del, "rn?>", $decode);
file_put_contents($file.'.de.php' ,$decode);
unlink('0_'.$file);
echo 'done';
////////////
function val_replace($code, $val, $deval){
$code = str_replace('$'.$val.',', '$'.$deval.',', $code);
$code = str_replace('$'.$val.';', '$'.$deval.';', $code);
$code = str_replace('$'.$val.'=', '$'.$deval.'=', $code);
$code = str_replace('$'.$val.'(', '$'.$deval.'(', $code);
$code = str_replace('$'.$val.')', '$'.$deval.')', $code);
$code = str_replace('$'.$val.'.', '$'.$deval.'.', $code);
$code = str_replace('$'.$val.'/', '$'.$deval.'/', $code);
$code = str_replace('$'.$val.'>', '$'.$deval.'>', $code);
$code = str_replace('$'.$val.' 126 || $dec13 && $dec10){
return '['.$dec.']';
}else{
return chr($dec);
}
}
function destr($str, $val=0){
$k = 0;
$num = '';
$n = strlen($str);
$code = '';
for($i=0; $i
原文:http://dezend.qiling.org/991.html