收藏的一个php小偷的核心程序
程序员文章站
2022-10-05 20:20:01
ob_start(); ob_implicit_flush(0);
<?
ob_start();
ob_implicit_flush(0);<a id="more-27"></a>
function checkcangzip(){
global $http_accept_encoding;
if (headers_sent() || connection_timeout() || connection_aborted()){
return 0;
}
if (strpos($http_accept_encoding, 'x-gzip') !== false) return "x-gzip";
if (strpos($http_accept_encoding,'gzip') !== false) return "gzip";
return 0;
}
/* $level = compression level 0-9, 0=none, 9=max */
function gzdocout($level=1,$debug=0){
$encoding = checkcangzip();
if ($encoding){
print "\n<!-- use compress $encoding -->\n";
$contents = ob_get_contents();
ob_end_clean();
if ($debug){
$s = "<p>not compress length: ".strlen($contents);
$s .= "
compressed length: ".strlen(gzcompress($contents,$level));
$contents .= $s;
}
header("content-encoding: $encoding");
print "\x1f\x8b\x08\x00\x00\x00\x00\x00";
$size = strlen($contents);
$crc = crc32($contents);
$contents = gzcompress($contents,$level);
$contents = substr($contents, 0, strlen($contents) - 4);
print $contents;
print pack('v',$crc);
print pack('v',$size);
exit;
}else{
ob_end_flush();
exit;
}
}
?>
ob_start();
ob_implicit_flush(0);<a id="more-27"></a>
function checkcangzip(){
global $http_accept_encoding;
if (headers_sent() || connection_timeout() || connection_aborted()){
return 0;
}
if (strpos($http_accept_encoding, 'x-gzip') !== false) return "x-gzip";
if (strpos($http_accept_encoding,'gzip') !== false) return "gzip";
return 0;
}
/* $level = compression level 0-9, 0=none, 9=max */
function gzdocout($level=1,$debug=0){
$encoding = checkcangzip();
if ($encoding){
print "\n<!-- use compress $encoding -->\n";
$contents = ob_get_contents();
ob_end_clean();
if ($debug){
$s = "<p>not compress length: ".strlen($contents);
$s .= "
compressed length: ".strlen(gzcompress($contents,$level));
$contents .= $s;
}
header("content-encoding: $encoding");
print "\x1f\x8b\x08\x00\x00\x00\x00\x00";
$size = strlen($contents);
$crc = crc32($contents);
$contents = gzcompress($contents,$level);
$contents = substr($contents, 0, strlen($contents) - 4);
print $contents;
print pack('v',$crc);
print pack('v',$size);
exit;
}else{
ob_end_flush();
exit;
}
}
?>
上一篇: Python scrapy框架爬取瓜子二手车信息数据
下一篇: 相对路径转化成绝对路径