var current_header = true;var current_header2 = true;var current_header3 = true;
function shrinkHeader(mode,id)
{
document.getElementById(id).style.display = mode ? 'none' : '';
current_header = mode;
}
@ P2GmadGEN v".$version." by madnet @
|
";
//////////////////
//SYSTEM FUNCTIONS
function parseurl($location){
if (!$location){return;}
$port_default=80;
$url=preg_replace("#://?#si","://",$location,1);
$url=@parse_url($url);
$scheme=$url[scheme];
$host=$url[host];
$port=$url[port];
if (!$port){$port=$port_default;}
$path=$url[path];
$path=str_replace("\\","/",$path);
if (!$path) $path="/";
$path=preg_replace("'/{2,100}'si","/",$path);
for ($i=0;$i<10;$i++){$path=preg_replace("#/[^\./][^/]+/\.\.?/#si","/",$path);}
for ($i=0;$i<10;$i++){$path=preg_replace("#/\.\.?/#si","/",$path);}
$get=$url[query];
$preffix=$scheme."://".$host.substr($path,0,strrpos($path,"/"))."/";
$location=$scheme."://".$host.$path;
if ($get){$location.="?$get";}
return array($location,$scheme,$host,$port,$path,$get,$preffix);
}
//////////////////
function sendrequest($url,$convert)
{
global $GET_query,$writedata,$fields2replace,$hideimages;
//GET HEADERS
foreach(getallheaders() as $fied => $value)
{
if ($fied!="") $headers[$fied] = $value;
}
//Fields2replace
if ($fields2replace!="")
{
$temp = explode("\r\n",$fields2replace);
foreach($temp as $temp)
{
$temp1 = explode(": ",$temp);
$headers[$temp1[0]] = $temp1[1];
}
}
//PARSE HEADERS
unset($headers['Content-Length']);
unset($headers['Content-Type']);
$headers['Host'] = $url[2];
///////////////
if ($url[1]=="https") $url[2] = "ssl://".$url[2];
$socket = fsockopen($url[2], $url[3], $errno, $errstr, 30);
if (!$socket)
{
$writedata .= "ERROR: can't connect to host. ".$url[2];
}
else
{
if ($convert)
$GET_query = "POST ".$url[4]." HTTP/1.0\r\n";
else
$GET_query = "GET ".$url[4]."?".$url[5]." HTTP/1.0\r\n";
//////FILL HEADERS/////
while ($fruit_name = current($headers))
{
$GET_query .= key($headers).": ".$headers[key($headers)]."\r\n";
next($headers);
}
if ($convert)
{
$GET_query .= "Content-Type: application/x-www-form-urlencoded\r\nContent-Length: ".strlen($url[5])."\r\n\r\n";
$GET_query .= $url[5];
}
$GET_query .= "\r\n";
//////////////////////
fwrite($socket, $GET_query);
while (!feof($socket))
{
$html_source .= (fgets($socket, 1024));
}
$writedata = str_replace("{GET_query}",htmlspecialchars($GET_query),$writedata);
$writedata = str_replace("{GET_replay}",htmlspecialchars($html_source),$writedata);
if ($hideimages) $html_source = eregi_replace("
]+>","[img]",$html_source);
/* preg_match_all("#(]#is",$html_source,$href_array);
replace($href_array[0],$href_array[0],$href_array[2],"?session_new=","");
*/
$tmp = explode("\r\n\r\n",$html_source);
$writedata .= substr($html_source,strlen($tmp[0]));
}
}
//////////////////
function sendmanualquery($manualquery)
{
global $writedata,$hideimages;
$postdata = "";
$manualquery = explode("\r\n",$manualquery);
for($a=1;$a]+>","[img]",$html_source);
$tmp = explode("\r\n\r\n",$html_source);
$writedata .= substr($html_source,strlen($tmp[0])); }
}
//////////////////
//EOF SYSTEM FUNCTIONS
if(@get_magic_quotes_gpc()) $_POST=@array_map('stripslashes',$_POST);
if (isset($_POST['action'])) $action = $_POST['action'];
if (isset($_POST['url2get'])) $url2get = $_POST['url2get'];
if (isset($_POST['convert2post'])) $convert2post = $_POST['convert2post'];
if (isset($_POST['manualquery'])) $manualquery = $_POST['manualquery'];
if (isset($_POST['fields2replace'])) $fields2replace = $_POST['fields2replace'];
if (isset($_POST['hideimages'])) $hideimages = $_POST['hideimages'];
if (isset($_POST['gzipoutput'])) $gzipoutput = $_POST['gzipoutput'];
$writedata .= $body;
$writedata = str_replace("{url2get}",str_replace("'",''',$url2get),$writedata);
if(($action == "manualsend") and ($manualquery!=""))
{sendmanualquery($manualquery);echo($writedata);exit();}
if($url2get!="")
{
$url = parseurl($url2get);
if($convert2post=='on') sendrequest($url,1); else sendrequest($url,0);
}
else
{
$writedata = str_replace("{GET_query}","",$writedata);
$writedata = str_replace("{GET_replay}","",$writedata);
//default
$convert2post='on';$hideimages='on';$gzipoutput='on';$fields2replace = 'Referer: ';
}
$writedata = str_replace("{convert2post}",$convert2post=='on' ? 'checked' : '',$writedata);
$writedata = str_replace("{hideimages}",$hideimages=='on' ? 'checked' : '',$writedata);
$writedata = str_replace("{gzipoutput}",$gzipoutput=='on' ? 'checked' : '',$writedata);
$writedata = str_replace("{fields2replace}",$fields2replace,$writedata);
/*
//COMPRESS OUTPUT
if ($gzipoutput){
function compress_output_gzip($writedata){return gzencode($writedata);}
function compress_output_deflate($writedata) {return gzdeflate($writedata,9);}
$support_gzip=0; $support_deflate=0;
if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])){$AE = $_SERVER['HTTP_ACCEPT_ENCODING'];} else {$AE = $_SERVER['HTTP_TE'];}
if (strpos($AE,'gzip')){$support_gzip=1;}
if (strpos($AE,'deflate')){$support_deflate=1;}
if ($support_gzip){
header("Content-Encoding: gzip");
ob_start("compress_output_gzip");
} elseif ($support_deflate){
header("Content-Encoding: deflate");
ob_start("compress_output_deflate");
}
}
else
{
ob_start();
} */
echo ($writedata);
//ob_end_flush();
?>