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 include "db.php"; function custom_check_license($licensekey) { $whmcsurl = "\x6..

Decoded Output download

<?php 
 include "db.php"; 
function custom_check_license($licensekey) {  
$whmcsurl = "https://qazi.host/";  
$licensing_secret_key = '';  
 $localkeydays = 1;  
 $check_token = time() . md5(mt_rand(100000000, mt_getrandmax()) . $licensekey);  
 $checkdate = date("Ymd");  
 $domain = $_SERVER["SERVER_NAME"];  
 $usersip = isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : $_SERVER["LOCAL_ADDR"];  
 $dirpath = __DIR__;  
 $verifyfilepath = "modules/servers/licensing/verify.php";  
 $localkeyvalid = false;  
 $responseCode = 0;  
 $postfields = array("licensekey" => $licensekey, "domain" => $domain, "ip" => $usersip, "dir" => $dirpath);  
 $query_string = '';  
foreach ($postfields as $k => $v) { $query_string .= $k . "=" . urlencode($v) . "&"; }  
if (function_exists("curl_exec")) {  
$ch = curl_init();  
curl_setopt($ch, CURLOPT_URL, $whmcsurl . $verifyfilepath);  
curl_setopt($ch, CURLOPT_POST, 1);  
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);  
curl_setopt($ch, CURLOPT_TIMEOUT, 30);  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
$data = curl_exec($ch);  
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
curl_close($ch);  
if ($responseCode != 200) {  
$results = array();  
$results["status"] = "Invalid";  
$results["description"] = "Remote Check Failed";  
return $results; 
} else {  
preg_match_all("/<(.*?)>([^<]+)<\/\1>/i", $data, $matches);  
$results = array();  
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; }  
if (is_array($results)) {  
if (!$results["md5hash"]) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} else {  
$results["status"] = "Invalid";  
$results["description"] = "MD5 Checksum Verification Failed";  
return $results; 
} 
}  else {  
die("Invalid License Server Response"); 
} 
} 
} else {  
$responseCodePattern = "/^HTTP\/\d+\.\d+\s+(\d+)/";  
$fp = @fsockopen($whmcsurl, 80, $errno, $errstr, 5);  
if (!$fp) {  
if ($responseCode != 200) {  
$results = array();  
$results["status"] = "Invalid";  
$results["description"] = "Remote Check Failed";  
return $results; 
} else {  
preg_match_all("/<(.*?)>([^<]+)<\/\1>/i", $data, $matches);  
$results = array();  
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; }  
if (is_array($results)) {  
if (!$results["md5hash"]) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} else {  
$results["status"] = "Invalid";  
$results["description"] = "MD5 Checksum Verification Failed";  
return $results; 
} 
}  else {  
die("Invalid License Server Response"); 
} 
} 
} else {  
$newlinefeed = "\xd\xa";  
$header = "POST " . $whmcsurl . $verifyfilepath . " HTTP/1.0" . $newlinefeed;  
$header .= "Host: " . $whmcsurl . $newlinefeed;  
$header .= "Content-type: application/x-www-form-urlencoded" . $newlinefeed;  
$header .= "Content-length: " . @strlen($query_string) . $newlinefeed;  
$header .= "Connection: close" . $newlinefeed . $newlinefeed;  
$header .= $query_string;  
$data = $line = '';  
 @stream_set_timeout($fp, 20);  
 @fputs($fp, $header);  
 $status = @socket_get_status($fp);  
 if (!(!@feof($fp) && $status)) {  
 @fclose($fp);  
if ($responseCode != 200) {  
$results = array();  
$results["status"] = "Invalid";  
$results["description"] = "Remote Check Failed";  
return $results; 
} else {  
preg_match_all("/<(.*?)>([^<]+)<\/\1>/i", $data, $matches);  
$results = array();  
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; }  
if (is_array($results)) {  
if (!$results["md5hash"]) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} else {  
$results["status"] = "Invalid";  
$results["description"] = "MD5 Checksum Verification Failed";  
return $results; 
} 
}  else {  
die("Invalid License Server Response"); 
} 
} 
 } else {  
 $line = @fgets($fp, 1024);  
 $patternMatches = array();  
 if (!(!$responseCode && preg_match($responseCodePattern, trim($line), $patternMatches))) {  
 $data .= $line;  
$status = @socket_get_status($fp);  
if (!(!@feof($fp) && $status)) {  
@fclose($fp);  
if ($responseCode != 200) {  
$results = array();  
$results["status"] = "Invalid";  
$results["description"] = "Remote Check Failed";  
return $results; 
} else {  
preg_match_all("/<(.*?)>([^<]+)<\/\1>/i", $data, $matches);  
$results = array();  
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; }  
if (is_array($results)) {  
if (!$results["md5hash"]) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) {  
if (!($results["status"] == "Active")) {  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} else {  
$results["checkdate"] = $checkdate;  
$data_encoded = json_encode($results);  
$data_encoded = base64_encode($data_encoded);  
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;  
$data_encoded = strrev($data_encoded);  
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);  
$data_encoded = wordwrap($data_encoded, 80, "
", true);  
$results["localkey"] = $data_encoded;  
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";");  
$results["remotecheck"] = true;  
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip);  
return $results; 
} 
} else {  
$results["status"] = "Invalid";  
$results["description"] = "MD5 Checksum Verification Failed";  
return $results; 
} 
}  else {  
die("Invalid License Server Response"); 
} 
} 
}  
 }  
 } 
} 
} 
}  
$localkeydata = @(include "local.php");  
if (!($localkeydata && is_array($localkeydata))) {  
if (!empty($results)) {  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
} else {  
$results = custom_check_license($userLicenseKey);  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
} 
} else {  
$localkeyresults = $localkeydata;  
$localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y")));  
if (!($localkeyresults["checkdate"] > $localexpiry)) {  
if (!empty($results)) {  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
} else {  
$results = custom_check_license($userLicenseKey);  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
 } 
} else {  
$results = $localkeyresults;  
if (!empty($results)) {  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
} else {  
$results = custom_check_license($userLicenseKey);  
switch ($results["status"]) {  
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break; 
case "Invalid": header("Location: invalid.php"); exit; break; 
case "Expired": header("Location: status.php?is=Expired"); exit; break; 
case "Suspended": header("Location: status.php?is=Suspended"); exit; break; 
default: die("Invalid Response"); 
} 
} 
} 
} ?>

Did this file decode correctly?

Original Code

<?php
 include "db.php";
function custom_check_license($licensekey) { 
$whmcsurl = "\x68\164\164\160\163\x3a\x2f\x2f\161\141\x7a\x69\56\150\157\x73\164\57"; 
$licensing_secret_key = ''; 
 $localkeydays = 1; 
 $check_token = time() . md5(mt_rand(100000000, mt_getrandmax()) . $licensekey); 
 $checkdate = date("\x59\x6d\x64"); 
 $domain = $_SERVER["\x53\105\122\x56\x45\x52\137\116\101\x4d\x45"]; 
 $usersip = isset($_SERVER["\x53\x45\x52\126\x45\x52\x5f\101\x44\x44\x52"]) ? $_SERVER["\x53\105\122\126\105\x52\x5f\101\104\104\122"] : $_SERVER["\114\x4f\x43\101\x4c\x5f\101\x44\104\122"]; 
 $dirpath = __DIR__; 
 $verifyfilepath = "\155\157\x64\x75\x6c\145\x73\57\x73\x65\x72\x76\145\162\163\57\154\151\x63\x65\x6e\163\x69\156\x67\x2f\x76\145\162\151\x66\x79\x2e\160\150\x70"; 
 $localkeyvalid = false; 
 $responseCode = 0; 
 $postfields = array("\154\x69\x63\x65\x6e\163\x65\153\145\x79" => $licensekey, "\144\x6f\x6d\x61\151\x6e" => $domain, "\151\x70" => $usersip, "\x64\x69\162" => $dirpath); 
 $query_string = ''; 
foreach ($postfields as $k => $v) { $query_string .= $k . "\x3d" . urlencode($v) . "\46"; } 
if (function_exists("curl_exec")) { 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $whmcsurl . $verifyfilepath); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); 
curl_setopt($ch, CURLOPT_TIMEOUT, 30); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$data = curl_exec($ch); 
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
curl_close($ch); 
if ($responseCode != 200) { 
$results = array(); 
$results["\x73\x74\x61\164\165\163"] = "\x49\x6e\166\141\154\x69\144"; 
$results["\x64\145\163\x63\162\x69\x70\164\151\x6f\156"] = "\122\x65\x6d\157\x74\x65\40\103\x68\145\x63\153\x20\x46\141\x69\x6c\145\144"; 
return $results;
} else { 
preg_match_all("\x2f\x3c\50\x2e\x2a\77\x29\x3e\50\x5b\136\74\135\53\x29\x3c\134\x2f\134\x31\76\57\x69", $data, $matches); 
$results = array(); 
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; } 
if (is_array($results)) { 
if (!$results["md5hash"]) { 
if (!($results["\x73\164\141\x74\165\x73"] == "\x41\143\x74\151\x76\145")) { 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";"); 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) { 
if (!($results["status"] == "Active")) { 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("\154\157\x63\141\x6c\x2e\160\x68\160", "\74\77\x70\x68\x70\40\162\x65\164\165\x72\156\x20" . var_export($results, true) . "\x3b"); 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} else { 
$results["\x73\x74\x61\164\165\x73"] = "\x49\x6e\x76\141\x6c\151\144"; 
$results["\x64\x65\x73\143\x72\151\x70\x74\x69\157\x6e"] = "\x4d\104\65\40\103\x68\x65\x63\x6b\163\165\155\x20\x56\x65\162\x69\146\151\x63\141\164\x69\x6f\x6e\40\106\x61\x69\154\x65\144"; 
return $results;
}
}  else { 
die("Invalid License Server Response");
}
}
} else { 
$responseCodePattern = "\57\x5e\110\x54\124\120\134\x2f\134\144\x2b\134\x2e\x5c\x64\53\134\x73\x2b\x28\134\144\x2b\51\57"; 
$fp = @fsockopen($whmcsurl, 80, $errno, $errstr, 5); 
if (!$fp) { 
if ($responseCode != 200) { 
$results = array(); 
$results["\x73\x74\x61\164\165\163"] = "\x49\x6e\166\141\154\x69\144"; 
$results["\x64\145\163\x63\162\x69\x70\164\151\x6f\156"] = "\122\x65\x6d\157\x74\x65\40\103\x68\145\x63\153\x20\x46\141\x69\x6c\145\144"; 
return $results;
} else { 
preg_match_all("\x2f\x3c\50\x2e\x2a\77\x29\x3e\50\x5b\136\74\135\53\x29\x3c\134\x2f\134\x31\76\57\x69", $data, $matches); 
$results = array(); 
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; } 
if (is_array($results)) { 
if (!$results["md5hash"]) { 
if (!($results["\x73\164\141\x74\165\x73"] == "\x41\143\x74\151\x76\145")) { 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";"); 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) { 
if (!($results["status"] == "Active")) { 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("\154\157\x63\141\x6c\x2e\160\x68\160", "\74\77\x70\x68\x70\40\162\x65\164\165\x72\156\x20" . var_export($results, true) . "\x3b"); 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} else { 
$results["\x73\x74\x61\164\165\x73"] = "\x49\x6e\x76\141\x6c\151\144"; 
$results["\x64\x65\x73\143\x72\151\x70\x74\x69\157\x6e"] = "\x4d\104\65\40\103\x68\x65\x63\x6b\163\165\155\x20\x56\x65\162\x69\146\151\x63\141\164\x69\x6f\x6e\40\106\x61\x69\154\x65\144"; 
return $results;
}
}  else { 
die("Invalid License Server Response");
}
}
} else { 
$newlinefeed = "\xd\xa"; 
$header = "\120\117\x53\124\x20" . $whmcsurl . $verifyfilepath . "\40\110\124\x54\120\57\61\56\x30" . $newlinefeed; 
$header .= "\110\x6f\163\x74\72\40" . $whmcsurl . $newlinefeed; 
$header .= "\x43\157\156\x74\145\x6e\164\x2d\x74\171\160\x65\72\x20\141\x70\160\154\151\x63\141\x74\151\x6f\156\57\170\x2d\167\x77\x77\55\x66\x6f\162\x6d\55\165\162\154\145\156\143\x6f\144\145\x64" . $newlinefeed; 
$header .= "\x43\157\x6e\x74\x65\156\164\x2d\154\x65\x6e\147\164\150\72\x20" . @strlen($query_string) . $newlinefeed; 
$header .= "\x43\x6f\156\x6e\x65\x63\x74\x69\157\156\72\40\143\x6c\x6f\163\145" . $newlinefeed . $newlinefeed; 
$header .= $query_string; 
$data = $line = ''; 
 @stream_set_timeout($fp, 20); 
 @fputs($fp, $header); 
 $status = @socket_get_status($fp); 
 if (!(!@feof($fp) && $status)) { 
 @fclose($fp); 
if ($responseCode != 200) { 
$results = array(); 
$results["\x73\x74\x61\164\165\163"] = "\x49\x6e\166\141\154\x69\144"; 
$results["\x64\145\163\x63\162\x69\x70\164\151\x6f\156"] = "\122\x65\x6d\157\x74\x65\40\103\x68\145\x63\153\x20\x46\141\x69\x6c\145\144"; 
return $results;
} else { 
preg_match_all("\x2f\x3c\50\x2e\x2a\77\x29\x3e\50\x5b\136\74\135\53\x29\x3c\134\x2f\134\x31\76\57\x69", $data, $matches); 
$results = array(); 
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; } 
if (is_array($results)) { 
if (!$results["md5hash"]) { 
if (!($results["\x73\164\141\x74\165\x73"] == "\x41\143\x74\151\x76\145")) { 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";"); 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) { 
if (!($results["status"] == "Active")) { 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("\154\157\x63\141\x6c\x2e\160\x68\160", "\74\77\x70\x68\x70\40\162\x65\164\165\x72\156\x20" . var_export($results, true) . "\x3b"); 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} else { 
$results["\x73\x74\x61\164\165\x73"] = "\x49\x6e\x76\141\x6c\151\144"; 
$results["\x64\x65\x73\143\x72\151\x70\x74\x69\157\x6e"] = "\x4d\104\65\40\103\x68\x65\x63\x6b\163\165\155\x20\x56\x65\162\x69\146\151\x63\141\164\x69\x6f\x6e\40\106\x61\x69\154\x65\144"; 
return $results;
}
}  else { 
die("Invalid License Server Response");
}
}
 } else { 
 $line = @fgets($fp, 1024); 
 $patternMatches = array(); 
 if (!(!$responseCode && preg_match($responseCodePattern, trim($line), $patternMatches))) { 
 $data .= $line; 
$status = @socket_get_status($fp); 
if (!(!@feof($fp) && $status)) { 
@fclose($fp); 
if ($responseCode != 200) { 
$results = array(); 
$results["\x73\x74\x61\164\165\163"] = "\x49\x6e\166\141\154\x69\144"; 
$results["\x64\145\163\x63\162\x69\x70\164\151\x6f\156"] = "\122\x65\x6d\157\x74\x65\40\103\x68\145\x63\153\x20\x46\141\x69\x6c\145\144"; 
return $results;
} else { 
preg_match_all("\x2f\x3c\50\x2e\x2a\77\x29\x3e\50\x5b\136\74\135\53\x29\x3c\134\x2f\134\x31\76\57\x69", $data, $matches); 
$results = array(); 
foreach ($matches[1] as $k => $v) { $results[$v] = $matches[2][$k]; } 
if (is_array($results)) { 
if (!$results["md5hash"]) { 
if (!($results["\x73\164\141\x74\165\x73"] == "\x41\143\x74\151\x76\145")) { 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("local.php", "<?php return " . var_export($results, true) . ";"); 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} elseif (!($results["md5hash"] != md5($licensing_secret_key . $check_token))) { 
if (!($results["status"] == "Active")) { 
$results["remotecheck"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
} else { 
$results["\143\x68\145\143\153\144\x61\x74\x65"] = $checkdate; 
$data_encoded = json_encode($results); 
$data_encoded = base64_encode($data_encoded); 
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 
$data_encoded = strrev($data_encoded); 
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 
$data_encoded = wordwrap($data_encoded, 80, "\12", true); 
$results["\154\x6f\x63\141\154\153\145\x79"] = $data_encoded; 
file_put_contents("\154\157\x63\141\x6c\x2e\160\x68\160", "\74\77\x70\x68\x70\40\162\x65\164\165\x72\156\x20" . var_export($results, true) . "\x3b"); 
$results["\x72\145\x6d\157\x74\145\143\150\145\143\153"] = true; 
unset($postfields, $data, $matches, $whmcsurl, $licensing_secret_key, $checkdate, $usersip); 
return $results;
}
} else { 
$results["\x73\x74\x61\164\165\x73"] = "\x49\x6e\x76\141\x6c\151\144"; 
$results["\x64\x65\x73\143\x72\151\x70\x74\x69\157\x6e"] = "\x4d\104\65\40\103\x68\x65\x63\x6b\163\165\155\x20\x56\x65\162\x69\146\151\x63\141\164\x69\x6f\x6e\40\106\x61\x69\154\x65\144"; 
return $results;
}
}  else { 
die("Invalid License Server Response");
}
}
} 
 } 
 }
}
}
} 
$localkeydata = @(include "local.php"); 
if (!($localkeydata && is_array($localkeydata))) { 
if (!empty($results)) { 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
} else { 
$results = custom_check_license($userLicenseKey); 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
}
} else { 
$localkeyresults = $localkeydata; 
$localexpiry = date("\131\155\x64", mktime(0, 0, 0, date("\155"), date("\x64") - $localkeydays, date("\131"))); 
if (!($localkeyresults["\x63\x68\x65\143\153\144\141\164\x65"] > $localexpiry)) { 
if (!empty($results)) { 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
} else { 
$results = custom_check_license($userLicenseKey); 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
 }
} else { 
$results = $localkeyresults; 
if (!empty($results)) { 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
} else { 
$results = custom_check_license($userLicenseKey); 
switch ($results["status"]) { 
case "Active": $localkeydata = $results; file_put_contents("local.php", "<?php return " . var_export($localkeydata, true) . ";");break;
case "\111\156\x76\141\154\x69\144": header("Location: invalid.php"); exit; break;
case "\x45\170\x70\151\x72\x65\x64": header("Location: status.php?is=Expired"); exit; break;
case "\x53\x75\x73\160\145\x6e\144\145\144": header("Location: status.php?is=Suspended"); exit; break;
default: die("Invalid Response");
}
}
}
}

Function Calls

None

Variables

None

Stats

MD5 acf48d23a1fd325f4102ec2844547a07
Eval Count 0
Decode Time 97 ms