配色: 字号:
破解php代码混淆加密的程序
2012-06-12 | 阅:  转:  |  分享 
  
破解php代码混淆加密的程序

代码混淆加密——虽然是雕虫小技的加密方式,但手工解出来还是蛮费时间,尤其是有一大堆加密程序的时候。

注意:程序会在同目录生成和删除tmp.php


/by2670148552011-7-18/

//$file=''global.func.php'';$hd=opendir(''./'');while($f=readdir($hd)){if($f==''.''||$f==''..'')continue;

$file=$f;$strs=file($file);$code=$strs[1];

if(strpos($code,''$OOO0O0O00'')===0){$arr=decode($code);$arr=checkagain($arr);//加密很深的话多checkagain几次///输出文件所有代码$arr=checkagain($arr);echo''
'';print_r($arr);echo''
'';/

//输出文件有用代码$arr=checkagain($arr,1);

file_put_contents(''jm_''.$file,"");//echo$arr;}elseecho''无需解密'';

}//////////////////////////////////////////////////////////functioncheckagain($arr,$out=0){//}

functiongetrlcode($arr,$key){$str=''";file_put_contents(''tmp.php'',$str);include''tmp.php'';unlink(''tmp.php'');return$$key;}

functiondecode($str){global$file;$codearr=$tmpcodearr=array();$arr=explode('';'',trim($str));$i=1;foreach($arras$v){$v=trim($v);$v=str_replace(''__FILE__'',''\''''.$file.''\'''',$v);if($v==''?>'')break;if($v==''return'')continue;if(strpos($v,''eval'')===0){unset($tmpcodearr);$tmpcodearr=$codearr;$key=''str''.$i;$tmpcodearr[]=''$''.$key.''=''.findstr($v).";\r\n";$newstr=getrlcode($tmpcodearr,$key);unset($tmpcodearr);$tmpcodearr=explode('';'',trim($newstr));foreach($tmpcodearras$v){trim($v)&&$codearr[]=trim($v).";\r\n";}$i++;}else{$codearr[]=$v.";\r\n";}}return$codearr;}

//gbk的文件格式functionfindstr($str){$i=4;while($str[$i]==''(''){$i++;}returnsubstr($str,$i,strlen($str)-$i-($i-4));}?>



献花(0)
+1
(本文系红人会首藏)