壓縮編碼(加密)代碼: 復制代碼 代碼如下:<?php function encode_f " /> 亚洲日韩视频,色黄视频在线观看,91嫩草亚洲精品

色尼玛亚洲综合影院,亚洲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壓縮編碼和解碼代碼,轉載需保留來源!

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

主站蜘蛛池模板: 凌云县| 靖宇县| 鄱阳县| 武平县| 南乐县| 沛县| 万州区| 郎溪县| 彭泽县| 深泽县| 仪征市| 密山市| 张掖市| 平罗县| 乃东县| 那坡县| 高雄县| 鱼台县| 唐山市| 阿巴嘎旗| 象山县| 阿坝县| 阜康市| 社会| 萍乡市| 宁安市| 昭觉县| 观塘区| 昭平县| 视频| 寻甸| 自治县| 茂名市| 肇源县| 吴旗县| 濮阳市| 邻水| 乌拉特前旗| 泗阳县| 临颍县| 瓮安县|