壓縮編碼(加密)代碼: 復制代碼 代碼如下:<?php function encode_f " /> 国产乱人伦精品一区二区 ,亚洲一区二区三区毛片,在线欧美福利

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

PHP base64+gzinflate壓縮編碼和解碼代碼

base64+gzinflate壓縮編碼(加密)過的文件通常是以 <? eval(gzinflate(base64_decode( 為頭的一個php文件。以下我們給出了相關的編碼解碼(加密解密)代碼。

壓縮編碼(加密)代碼:
復制代碼 代碼如下:
<?php
function encode_file_contents($filename) {
$type=strtolower(substr(strrchr($filename,'.'),1));
if('php'==$type && is_file($filename) && is_writable($filename)){// 如果是php文件 并且可寫 則進行壓縮編碼
$contents = file_get_contents($filename);// 判斷文件是否已經被編碼處理
$pos = strpos($contents,'/*Protected by 草名 http://www.crazyi.cn Cryptation*/');
if(false === $pos || $pos>100){ // 去除php文件注釋和空白,減少文件大小
$contents = php_strip_whitespace($filename);
// 去除php頭部和尾部標識
$headerPos = strpos($contents,'<?php');
$footerPos = strrpos($contents,'?>');
$contents = substr($contents,$headerPos+5,$footerPos-$headerPos);
$encode = base64_encode(gzdeflate($contents));// 開始編碼
$encode = '<?php'." /*Protected by 草名 http://www.crazyi.cn Cryptation*//n eval(gzinflate(base64_decode(".$encode.")));/n /*Reverse engineering is illegal and strictly prohibited- (C)草名 Cryptation 2008*/ /n?>";
return file_put_contents($filename,$encode);
}
}
return false;
}
//調用函數
$filename='g:/我的文檔/桌面/test.php';
encode_file_contents($filename);
?>
<?php
function encode_file_contents($filename) {
$type=strtolower(substr(strrchr($filename,'.'),1));
if('php'==$type && is_file($filename) && is_writable($filename)){// 如果是php文件 并且可寫 則進行壓縮編碼
$contents = file_get_contents($filename);// 判斷文件是否已經被編碼處理
$pos = strpos($contents,'/*Protected by 草名 http://www.crazyi.cn Cryptation*/');
if(false === $pos || $pos>100){ // 去除php文件注釋和空白,減少文件大小
$contents = php_strip_whitespace($filename);
// 去除php頭部和尾部標識
$headerPos = strpos($contents,'<?php');
$footerPos = strrpos($contents,'?>');
$contents = substr($contents,$headerPos+5,$footerPos-$headerPos);
$encode = base64_encode(gzdeflate($contents));// 開始編碼
$encode = '<?php'." /*Protected by 草名 http://www.crazyi.cn Cryptation*//n eval(gzinflate(base64_decode(".$encode.")));/n /*Reverse engineering is illegal and strictly prohibited- (C)草名 Cryptation 2008*/ /n?>";
return file_put_contents($filename,$encode);
}
}
return false;
}
//調用函數
$filename='g:/我的文檔/桌面/test.php';
encode_file_contents($filename);
?>


壓縮解碼(解密)代碼:
復制代碼 代碼如下:
<?php
$Code = '這里填寫要解密的編碼'; // base64編碼
$File = 'test.php';//解碼后保存的文件
$Temp = base64_decode($Code);
$temp = gzinflate($Temp);
$FP = fopen($File,"w");
fwrite($FP,$temp);
fclose($FP);
echo "解密成功!";
?>

php技術PHP base64+gzinflate壓縮編碼和解碼代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 垫江县| 扎兰屯市| 开原市| 乐清市| 晴隆县| 内江市| 桐柏县| 得荣县| 日土县| 应城市| 合肥市| 常熟市| 九龙县| 金乡县| 陈巴尔虎旗| 建平县| 莆田市| 禄丰县| 西充县| 北京市| 独山县| 禹州市| 永丰县| 进贤县| 昂仁县| 德阳市| 绍兴县| 贵州省| 克山县| 岐山县| 襄汾县| 淮南市| 乌苏市| 灵台县| 河西区| 永顺县| 连平县| 独山县| 西昌市| 宜良县| 泾川县|