Файл: xxx/index.php
Строк: 76
<?php
function require_head($title){
echo '
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="XXX Videos" />
<meta name="keywords" content="XXX, Videos, Pictures" />
<title>'.$title.'</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="http://johncms.com/theme/default/style.css">
</head>
<body>
';
}
$act = htmlspecialchars($_GET['act']);
$id = intval($_GET['id']);
$name = $_GET['name'];
switch($act){
default:
require_head('XXX Videos');
$url = 'http://cekac.net/download';
$file = file_get_contents($url);
preg_match_all('#<a href="dir_(.*?).html">(.*?)</a> (([0-9]+))#si', $file, $d);
for($i=0; $i<count($d[1]); $i++){
echo '<a href="?act=dir&id='.$d[1][$i].'">'.$d[2][$i].'</a> ('.$d[3][$i].')<hr>';
}
break;
case 'dir':
require_head('XXX Videos');
$purl = isset($_GET['page'])?'?cat='.$id.'&page='.intval($_GET['page']):'dir_'.$id.'.html';
$url = 'http://cekac.net/download/'.$purl;
$file = file_get_contents($url);
preg_match('#<div class="phdr">(.*?)</div>#si', $file, $ph);
$phd = preg_replace('#<a href="index.html">(.*)</a>#si', '<a href="?">XXX Видео</a>', $ph[1]);
echo '<div class="phdr">'.$phd.'</div>';
preg_match_all('#<div class="(list1|list2)"><img src="(.*?)" alt="."/> <a href="(.*?)">(.*?)</a>(.*?)loadfile.php?down=(.*?)">(.*?)</a>(.*?)</div>#si', $file, $f);
for($i=0; $i<count($f[1]); $i++){
$name = str_replace('xxxdom_org_', '', $f[4][$i]);
$name = str_replace('cekac_net_', '', $name);
echo '<div class="menu">
<img src="http://cekac.net/download/'.$f[2][$i].'" /><br />
<a href="?act=file&name='.$f[3][$i].'">'.$name.'</a> ('.$f[7][$i].')
</div>';
}
preg_match('#<div class="topmenu">(.*?)</div>#si', $file, $p);
$pa = preg_replace('#cat=([0-9]+)#si', 'act=dir&id='.$id, $p[1]);
echo '<div class="topmenu">
'.$pa.'
</div>';
break;
case 'file':
require_head('XXX Videos');
$url = 'http://cekac.net/download/'.$name;
$file = file_get_contents($url);
preg_match('#<div class="phdr">(.*?)</div>#si', $file, $ph);
$phd = str_replace('index.html', '?', $ph[1]);
$phd = str_replace('ХХХ-Загрузки', 'XXX Видео', $phd);
$phd = preg_replace('#dir_([0-9]+).html#si', '?act=dir&id=$1', $phd);
$phd = str_replace('xxxdom org ', '', $phd);
$phd = str_replace('cekac net ', '', $phd);
echo '<div class="phdr">'.$phd.'</div>';
preg_match_all('#<div class="menu">(.*?)</div>#si', $file, $me);
preg_match('#loadfile.php?down=(.*?)">#si', $me[1][6], $url);
echo '<div class="menu">
'.$me[1][1].'<br />
'.str_replace('<img src="../', '<img src="http://cekac.net/', $me[1][2]).'<br />
'.$me[1][4].'<br />
'.$me[1][5].'<br />
<a href="?act=download&url='.base64_encode($url[1]).'">Скачать</a>';
break;
case 'download':
$url = base64_decode($_GET['url']);
$url = 'http://cekac.net/download/files/'.$url;
$ex = explode('/', $url);
$name = str_replace('xxxdom_org_', '', end($ex));
$name = str_replace('cekac_net_', '', $name);
$he = get_headers($url, 1);
foreach($he as $key => $value){
header($key.': '.$value);
}
header('Content-Disposition: attachment; filename='.$name);
readfile($url);
break;
}
echo '</body>
</html>';
?>