Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

set_time_limit<?php chdir(dirname(__FILE__));chdir("../..");if(!file_exists("config.php"))..

Decoded Output download

set_time_limit<?php chdir(dirname(__FILE__));chdir("../..");if(!file_exists("config.php"))chdir("../..");require_once"config.php";$Mgb=DIR_CACHE."lightning/".'b';$Mpw=rand(0,10000000);Wlv(DIR_CACHE."lightning/"."cron_working",$Mpw);Wlv(DIR_CACHE."lightning/".'d',$Mpw);$M_j=DIR_CACHE."lightning/".'gz';if(file_exists($M_j)&&filemtime($M_j)>time()-30*60)$M_j=false;$M_k=time();Wkd();$Mpx=0;$Mpy=0;$Mdl=0;$Mou=0;function Wjh($Mil,$Mzd=""){$Map=DIR_CACHE."lightning/cron_activity";if(!file_exists($Map)){file_put_contents($Map,'');@chmod($Map,0777);} 
if(file_exists($Map)&&filesize($Map)>10000)return;@file_put_contents($Map,"<p class='$Mzd'>$Mil</p>
",FILE_APPEND|LOCK_EX);} 
$Madj=microtime(true);while(microtime(true)-$Madj<13*60){set_time_limit(120);touch(DIR_CACHE."lightning/"."cron_working");Wkd();if(!file_exists($Mgb.'aq')and($Mpx++<60)){if($Mdl){if($Mou>3)Wjh("$Mou pages generated in ".round(microtime(true)-$Mdl,2)." sec");$Mou=0;$Mdl=0;} 
if(!file_exists($Mgb.'aq')&&$Mpx==1)Wjh("Waiting for any task ...","wait");sleep(1);clearstatcache();continue;} 
$Mpx=0;if(file_get_contents(DIR_CACHE."lightning/"."cron_working")!=$Mpw){Wjh("Next CRON instance started, exiting","exit");Wkd("DONE");exit;} 
if(!$Mdl)$Mdl=microtime(true);$Mou++;if(file_exists($Mgb.'aq')){$data=unserialize(file_get_contents($Mgb.'aq'));if(!empty($data['av']["li_op"])&&$data['av']["li_op"]=="gens"){if($data['as'])$Mbe="https://";else$Mbe="http://";$Mbe.=$data['at'].$data['au'];Wjh("Page <a target='_blank' href='$Mbe'>$Mbe</a> visited, checking gen needs for it ...");} 
}else Wjh("While idle, checking gen needs for homepage ...");$Mlm=Wap(HTTP_SERVER."index.php?li_op=gen&rd=".rand(0,1000000).rand(0,1000000).rand(0,1000000),false,"Lightning CRON Job");if(!empty($Mze["x-opencart-lightning-gen"])){$Mbe=$Mze["x-opencart-lightning-gen"];$Maf=strpos($Mbe," (");$Mqi=substr($Mbe,$Maf+2,-1);$Mbe=substr($Mbe,0,$Maf);Wjh("Generated <a target='_blank' href='$Mbe'>$Mbe</a> <span style='color: grey'>($Mqi)</span>");if(!empty($Mze["x-opencart-lightning"]))Wjh(substr($Mze["x-opencart-lightning"],strpos($Mze["x-opencart-lightning"],' ')+1),"time_line");} 
if(!empty($Mze["x-opencart-lightning-gen"])&&strpos($Mze["x-opencart-lightning-gen"],"ending mail"))$Mpx=999;if($Mlm=="false"){sleep(5);continue;} 
if(strpos($Mlm,"OX")===false){if(empty($Magx))if(empty($Magw)){$Magw=true;$Mpz=true;}else$Mpz=false;if($Mpy++>5){global$Mdf;Wjh("$Mpy page retrieval faults, exiting!","exit");Wjh("URL: ".HTTP_SERVER."index.php?li_op=gen");Wjh("Code: ".$Mdf);Wjh("Result: ".$Mlm);if(!trim($Mlm))$Mlm="HTTP result code: ".$Mdf;Wkd("FAULT: ".$Mlm);exit(1);} 
}else{if(!empty($Mpz))$Magx=true;$Mpy=0;}} 
exit;function Wlv($Map,$Mxn){file_put_contents($Map,$Mxn,LOCK_EX);@chmod($Map,0777);} 
function Wkd($Mww=false){global$M_j,$M_k;if(!$M_j)return;if(!$Mww)$Mww=time()-$M_k;Wlv($M_j,$Mww);} 
function Wji($Mzf,$Mzg){global$Mze;$Mzh=strlen($Mzg);$Mzg=explode(':',$Mzg,2);if(count($Mzg)<2)return$Mzh;$Mze[strtolower(trim($Mzg[0]))]=trim($Mzg[1]);return$Mzh;} 
function Wap($Mbe,$Mhm=false,$Mhn="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36"){global$Mpz;if(!$Mpz)$Mbe=str_replace("https:","http:",$Mbe);static$Mho;if(!$Mho){$Mho=curl_init($Mbe);curl_setopt($Mho,CURLOPT_RETURNTRANSFER,1);curl_setopt($Mho,CURLOPT_ENCODING,"");curl_setopt($Mho,CURLOPT_USERAGENT,$Mhn);curl_setopt($Mho,CURLOPT_TIMEOUT,200);curl_setopt($Mho,CURLOPT_CONNECTTIMEOUT,200);curl_setopt($Mho,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($Mho,CURLOPT_SSL_VERIFYHOST,false);if($Mhm){curl_setopt($Mho,CURLOPT_POST,1);curl_setopt($Mho,CURLOPT_POSTFIELDS,$Mhm);} 
curl_setopt($Mho,CURLOPT_HEADERFUNCTION,'Wji');} 
curl_setopt($Mho,CURLOPT_URL,$Mbe);global$Mze;$Mze=array();$Mhp=curl_exec($Mho);global$Mdf;$Mdf=curl_getinfo($Mho,CURLINFO_HTTP_CODE);$Mrw=0;while($Mdf>299&&$Mdf<399){$Mpz=true;if(phpversion()<"5.3.7"||$Mrw++>3){curl_close($Mho);$Mho=false;return false;} 
$Mhq=curl_getinfo($Mho,CURLINFO_REDIRECT_URL);if(!$Mhq){$Mdf=500;curl_close($Mho);$Mho=false;return false;} 
curl_setopt($Mho,CURLOPT_URL,$Mhq);$Mhp=curl_exec($Mho);$Mdf=curl_getinfo($Mho,CURLINFO_HTTP_CODE);} 
return$Mhp;} ?>

Did this file decode correctly?

Original Code

set_time_limit<?php chdir(dirname(__FILE__));chdir("../..");if(!file_exists("config.php"))chdir("../..");require_once"config.php";$Mgb=DIR_CACHE."lightning/".'b';$Mpw=rand(0,10000000);Wlv(DIR_CACHE."lightning/"."cron_working",$Mpw);Wlv(DIR_CACHE."lightning/".'d',$Mpw);$M_j=DIR_CACHE."lightning/".'gz';if(file_exists($M_j)&&filemtime($M_j)>time()-30*60)$M_j=false;$M_k=time();Wkd();$Mpx=0;$Mpy=0;$Mdl=0;$Mou=0;function Wjh($Mil,$Mzd=""){$Map=DIR_CACHE."lightning/cron_activity";if(!file_exists($Map)){file_put_contents($Map,'');@chmod($Map,0777);}
if(file_exists($Map)&&filesize($Map)>10000)return;@file_put_contents($Map,"<p class='$Mzd'>$Mil</p>\n",FILE_APPEND|LOCK_EX);}
$Madj=microtime(true);while(microtime(true)-$Madj<13*60){set_time_limit(120);touch(DIR_CACHE."lightning/"."cron_working");Wkd();if(!file_exists($Mgb.'aq')and($Mpx++<60)){if($Mdl){if($Mou>3)Wjh("$Mou pages generated in ".round(microtime(true)-$Mdl,2)." sec");$Mou=0;$Mdl=0;}
if(!file_exists($Mgb.'aq')&&$Mpx==1)Wjh("Waiting for any task ...","wait");sleep(1);clearstatcache();continue;}
$Mpx=0;if(file_get_contents(DIR_CACHE."lightning/"."cron_working")!=$Mpw){Wjh("Next CRON instance started, exiting","exit");Wkd("DONE");exit;}
if(!$Mdl)$Mdl=microtime(true);$Mou++;if(file_exists($Mgb.'aq')){$data=unserialize(file_get_contents($Mgb.'aq'));if(!empty($data['av']["li_op"])&&$data['av']["li_op"]=="gens"){if($data['as'])$Mbe="https://";else$Mbe="http://";$Mbe.=$data['at'].$data['au'];Wjh("Page <a target='_blank' href='$Mbe'>$Mbe</a> visited, checking gen needs for it ...");}
}else Wjh("While idle, checking gen needs for homepage ...");$Mlm=Wap(HTTP_SERVER."index.php?li_op=gen&rd=".rand(0,1000000).rand(0,1000000).rand(0,1000000),false,"Lightning CRON Job");if(!empty($Mze["x-opencart-lightning-gen"])){$Mbe=$Mze["x-opencart-lightning-gen"];$Maf=strpos($Mbe," (");$Mqi=substr($Mbe,$Maf+2,-1);$Mbe=substr($Mbe,0,$Maf);Wjh("Generated <a target='_blank' href='$Mbe'>$Mbe</a> <span style='color: grey'>($Mqi)</span>");if(!empty($Mze["x-opencart-lightning"]))Wjh(substr($Mze["x-opencart-lightning"],strpos($Mze["x-opencart-lightning"],' ')+1),"time_line");}
if(!empty($Mze["x-opencart-lightning-gen"])&&strpos($Mze["x-opencart-lightning-gen"],"ending mail"))$Mpx=999;if($Mlm=="false"){sleep(5);continue;}
if(strpos($Mlm,"OX")===false){if(empty($Magx))if(empty($Magw)){$Magw=true;$Mpz=true;}else$Mpz=false;if($Mpy++>5){global$Mdf;Wjh("$Mpy page retrieval faults, exiting!","exit");Wjh("URL: ".HTTP_SERVER."index.php?li_op=gen");Wjh("Code: ".$Mdf);Wjh("Result: ".$Mlm);if(!trim($Mlm))$Mlm="HTTP result code: ".$Mdf;Wkd("FAULT: ".$Mlm);exit(1);}
}else{if(!empty($Mpz))$Magx=true;$Mpy=0;}}
exit;function Wlv($Map,$Mxn){file_put_contents($Map,$Mxn,LOCK_EX);@chmod($Map,0777);}
function Wkd($Mww=false){global$M_j,$M_k;if(!$M_j)return;if(!$Mww)$Mww=time()-$M_k;Wlv($M_j,$Mww);}
function Wji($Mzf,$Mzg){global$Mze;$Mzh=strlen($Mzg);$Mzg=explode(':',$Mzg,2);if(count($Mzg)<2)return$Mzh;$Mze[strtolower(trim($Mzg[0]))]=trim($Mzg[1]);return$Mzh;}
function Wap($Mbe,$Mhm=false,$Mhn="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36"){global$Mpz;if(!$Mpz)$Mbe=str_replace("https:","http:",$Mbe);static$Mho;if(!$Mho){$Mho=curl_init($Mbe);curl_setopt($Mho,CURLOPT_RETURNTRANSFER,1);curl_setopt($Mho,CURLOPT_ENCODING,"");curl_setopt($Mho,CURLOPT_USERAGENT,$Mhn);curl_setopt($Mho,CURLOPT_TIMEOUT,200);curl_setopt($Mho,CURLOPT_CONNECTTIMEOUT,200);curl_setopt($Mho,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($Mho,CURLOPT_SSL_VERIFYHOST,false);if($Mhm){curl_setopt($Mho,CURLOPT_POST,1);curl_setopt($Mho,CURLOPT_POSTFIELDS,$Mhm);}
curl_setopt($Mho,CURLOPT_HEADERFUNCTION,'Wji');}
curl_setopt($Mho,CURLOPT_URL,$Mbe);global$Mze;$Mze=array();$Mhp=curl_exec($Mho);global$Mdf;$Mdf=curl_getinfo($Mho,CURLINFO_HTTP_CODE);$Mrw=0;while($Mdf>299&&$Mdf<399){$Mpz=true;if(phpversion()<"5.3.7"||$Mrw++>3){curl_close($Mho);$Mho=false;return false;}
$Mhq=curl_getinfo($Mho,CURLINFO_REDIRECT_URL);if(!$Mhq){$Mdf=500;curl_close($Mho);$Mho=false;return false;}
curl_setopt($Mho,CURLOPT_URL,$Mhq);$Mhp=curl_exec($Mho);$Mdf=curl_getinfo($Mho,CURLINFO_HTTP_CODE);}
return$Mhp;}

Function Calls

chdir 1
dirname 1

Variables

None

Stats

MD5 b39d3493b558582a1550a43b0a4c9497
Eval Count 0
Decode Time 61 ms