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 function formatBytes($bytes, $decimals = 2) { $size = array("\102", "\113\x42", "..

Decoded Output download

<?php 
function formatBytes($bytes, $decimals = 2) {  
$size = array("B", "KB", "MB", "GB", "TB");  
$factor = floor((strlen($bytes) - 1) / 3);  
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . " " . @$size[$factor]; 
}  
if (!isset($_POST["download_link"])) {  
 
} else {  
$download_link = $_POST["download_link"];  
$file_info = @get_headers($download_link, 1);  
if (!$file_info || strpos($file_info[0], "404") !== false) {  
echo json_encode(["error" => "<center><span class='invalid-line fade-in'>Invalid/Unsupported Download Link</span></center>"]); 
} else {  
$file_name = basename($download_link);  
$file_size = $file_info["Content-Length"];  
echo json_encode(["success" => "File Size: " . formatBytes($file_size), "fileName" => $file_name]);  
} 
} ?>

Did this file decode correctly?

Original Code

<?php
function formatBytes($bytes, $decimals = 2) { 
$size = array("\102", "\113\x42", "\115\x42", "\x47\102", "\124\102"); 
$factor = floor((strlen($bytes) - 1) / 3); 
return sprintf("\45\56{$decimals}\x66", $bytes / pow(1024, $factor)) . "\x20" . @$size[$factor];
} 
if (!isset($_POST["\144\157\x77\x6e\154\x6f\141\144\x5f\x6c\x69\156\153"])) { 

} else { 
$download_link = $_POST["\x64\x6f\x77\x6e\154\x6f\x61\144\137\x6c\x69\156\x6b"]; 
$file_info = @get_headers($download_link, 1); 
if (!$file_info || strpos($file_info[0], "\x34\x30\x34") !== false) { 
echo json_encode(["\x65\x72\162\x6f\162" => "\74\x63\x65\x6e\164\145\x72\x3e\x3c\163\160\141\156\40\143\154\141\163\x73\75\x27\151\x6e\166\141\x6c\x69\144\55\x6c\x69\156\145\40\x66\x61\144\x65\55\151\156\47\76\111\x6e\166\141\154\151\x64\57\125\156\x73\165\x70\160\157\x72\x74\x65\x64\x20\104\157\x77\x6e\154\x6f\x61\144\40\114\x69\x6e\153\74\x2f\163\160\x61\x6e\x3e\x3c\x2f\143\x65\x6e\164\x65\x72\x3e"]);
} else { 
$file_name = basename($download_link); 
$file_size = $file_info["\x43\x6f\156\164\x65\x6e\x74\55\114\145\x6e\x67\164\150"]; 
echo json_encode(["\163\x75\143\x63\x65\x73\163" => "\x46\x69\x6c\x65\40\x53\x69\x7a\x65\72\40" . formatBytes($file_size), "\146\151\154\145\116\x61\x6d\x65" => $file_name]); 
}
}

Function Calls

None

Variables

None

Stats

MD5 9b1eeef0b38ac1ab4c72d4b20da3897a
Eval Count 0
Decode Time 61 ms