;
if($_SERVER['REQUEST_URI']!=="/"){
echo nl2br("\n");
$content=file_get_contents(__FILE__);
$dom=new DOMDocument();
@$dom->loadHTML($content);
$Temp=$b;
$script=(($dom->getElementById('main_out_script_OS'))->textContent).(($dom->getElementById('main_out_script_browser'))->textContent).(($dom->getElementById('main_out_script_hardware'))->textContent);
try{
function doJSthing($thing,$js){
global $JSdepth;
global $debug;
global $runingJSout;
$JSdepth+=1;
if($JSdepth>100){
throw new Error();
}
if(strpos($js,$thing)!==false){
$splitCode=[""];
$split=parseJS($js,1);
foreach($split as $js0){
if(substr($js0,0,1)=='"'&&substr($js0,-1,1)=='"'){
$splitCode[count($splitCode)-1].=$js0;
}else{
$split2=explode($thing,$js0);
$splitCode[count($splitCode)-1].=array_shift($split2);
foreach($split2 as $js2){
$splitCode[].=$js2;
}
}
}
}
if(strpos($js,$thing)!==false&&isset($splitCode[1])!==false){
$out="";
if($thing=="."||isset($runingJSout)==false){
$runingJSout="";
}
if($thing=="=="||$thing=="!=="||$thing=="!="||$thing=="||"||$thing=="&&"){
$tvale=array_shift($splitCode);
if(gettype($tvale)=="string"){
$runingJSout=doJS($tvale);
}else{
print_r($tvale);
}
}
foreach($splitCode as $item){
$prerunning=$runingJSout;
if($thing!=="."){
$tmpout=doJS($item);
}
if($thing=="+"){
$out.=$tmpout;
}else if($thing=="."){
$runingJSout=doJS($item,$runingJSout);
}else if($thing==">"){
$runingJSout=($prerunning>$tmpout?"1":"0");
}else if($thing=="<"){
$runingJSout=($prerunning<$tmpout?"1":"0");
}else if($thing=="=="){
$runingJSout=(("".$prerunning)==("".$tmpout)?"1":"0");
}else if($thing=="!=="||$thing=="!="){
$runingJSout=(("".$prerunning)!==("".$tmpout)?"1":"0");
}else if($thing=="||"){
$runingJSout=($prerunning||$tmpout?"1":"0");
}else if($thing=="&&"){
$runingJSout=($prerunning&&$tmpout?1:0);
}else{
$debug.="UNKOWN OP RAN:".$thing." ";
$out.=doJS($item,$runingJSout);
}
}
if($thing=="."||$out==""){
$out=$runingJSout;
}
$JSdepth-=1;
return($out);
}else{
$JSdepth-=1;
if($thing=="+"){
return(doJSthing("||",$js));
}
if($thing=="||"){
return(doJSthing("&&",$js));
}
if($thing=="&&"){
return(doJSthing("!==",$js));
}
if($thing=="!=="){
return(doJSthing("!=",$js));
}
if($thing=="!="){
return(doJSthing("==",$js));
}
if($thing=="=="){
return(doJSthing(">",$js));
}
if($thing==">"){
return(doJSthing("<",$js));
}
if($thing=="<"){
return(doJSthing(".",$js));
}
return($js);
}
}
function parseJS($js,$option=0){
global $debug;
global $JSdepth;
$in=$js;
$JSdepth+=1;
$code=str_split($js);
$parsedcode="";
$countparen=0;
$quoted=0;
$quoted2=0;
$last="";
$dolist=[];
foreach($code as $item){
if($option==1){
$parsedcode.=$item;
}
if($item=='"'&&$quoted==0&&$quoted2==0){
$quoted=1;
if($option==1){
$dolist[]=substr('"'.$parsedcode,1,-1);$parsedcode='"';
}
}else if($item=='"'&&$quoted==1&&$quoted2==0){
$quoted=0;
if($option==1){
$dolist[]=$parsedcode;$parsedcode="";
}
}
if($item=="'"&&$quoted2==0&&$quoted==0){
$quoted2=1;
if($option==1){
$dolist[]=substr("'".$parsedcode,1,-1);$parsedcode="'";
}
}else if($item=="'"&&$quoted2==1&&$quoted==0){
$quoted2=0;
if($option==1){
$dolist[]=$parsedcode;$parsedcode="";
}
}
if($option==0||$option==-1){
$dequoted=substr(" ".$parsedcode,1,-1);
if(($item=="("&&$option==0||($item!=='"'&&$last=='('&&$option==-1))&&$quoted==0&&$quoted2==0){
if($option==-1){
$tempvalue=parseJS($parsedcode);
}
if($option==0||isset($tempvalue[1])==false){
$countparen+=1;
if($countparen<2){
if($option==-1){
$parsedcode=$dequoted;
}
$dolist[]=$parsedcode;
$parsedcode="";
}
}
}
$parsedcode.=$item;
if($item==")"&&($last!=='"'||$option==0)&&$quoted==0&&$quoted2==0){
if($option==-1&&$in!==$parsedcode){
//$tempvalue=parseJS($parsedcode);
}
if($option==0||isset($tempvalue[2])==false){
$countparen-=1;
if(($countparen<2&&$option==0)||($countparen<1&&$option==-1)){
if($option==-1){
$parsedcode=$dequoted;
}
if(substr($parsedcode,0,1)=="."&&$option==-1){
$dolist[count($dolist)-1].=$parsedcode;
}else{
$tmpout=$parsedcode;
if($countparen>=0){
$tmpout=doJS($tmpout);
if($option==-1){
$dolist[count($dolist)-1].=$tmpout;
}
}
$dolist[]=$tmpout;
$parsedcode="";
}
}
}else{
if(isset($dolist[count($dolist)-1])==false){
$dolist[]="";
}
$dolist[count($dolist)-1].=$parsedcode;
}
}
$last=$item;
}
}
$debug.="\n".$option;
if(substr($parsedcode,0,1)=="."&&$option==-1){
if(count($dolist)>1){
$dolist[count($dolist)-1].=$parsedcode;
}
}
$dolist[]=$parsedcode;
foreach($dolist as $item){
if(gettype($item)!=="string"){
$item=serialize($item);
}
}
$JSdepth-=1;
return($dolist);
}
function doJS($js,$context="*no*"){
$in=$js;
global $JSdepth;
global $b;
global $d;
global $D;
global $B;
global $Temp;
global $debug;
$JSdepth+=1;
if($JSdepth>100){
throw new Error();
}
if(strlen($js)>0&&substr($js,0,1)=="("&&substr($js,-1,1)==")"&&isset(parseJS($js,1)[2])==false){
$js=substr($js,1,-1);
}
if(strlen($js)>0&&substr($js,0,1)=='"'&&substr($js,-1,1)=='"'&&(isset(parseJS($js,1)[1])==false||$js=='""')){
$js=substr($js,1,-1);
$JSdepth-=1;
return($js);
}
if($js=="d"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
if($d==""){
return(" ");
}
return($d);
}else{
return($d.$context);
}
}
if($js=="D"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
return($D);
}else{
return($D.$context);
}
}
if($js=="B"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
return($B);
}else{
return($B.$context);
}
}
if($js=="D"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
return($D);
}else{
return($D.$context);
}
}
if($js=="b"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
return($b);
}else{
return($b.$context);
}
}
if($js=="Temp"){
$JSdepth-=1;
if(isset($context)==false||$context==""){
return($Temp);
}else{
return($Temp.$context);
}
}
if($js=="PUFFINVERSION"){
$JSdepth-=1;
if(strpos($b,"Puffin/")!==false){
$puffin=explode(" ",explode("Puffin/",$b)[1])[0];
return($puffin[count($puffin)-1]+$puffin[count($puffin)-2]);
}else{
return("");
}
}
if($js=="HighEntropyValues"){
$JSdepth-=1;
return("no high entropy values");
}
if($js=="HEVp"){
$JSdepth-=1;
return("*N/A*");
}
if($js=="HEVpv"){
$JSdepth-=1;
return("*N/A*");
}
if($js=="plang"){
$JSdepth-=1;
return("php");
}
if($js=="webglInfo"){
$JSdepth-=1;
return("");
}
if($js=="undefined"){
$JSdepth-=1;
return("");
}
if($context=="no high entropy values"){
$JSdepth-=1;
return("no high entropy values");
}
if($context!=="*no*"){
if(strpos($js,"getVer")!==false){
$JSdepth-=1;
if(gettype($context)!==gettype("string")){
$debug.='e'.$context[0].'.'.$js;
return($context[0].'.'.$js);
}
$out=parseJS($js,1);
$out2=explode(doJS($out[1]),$context);
if(isset($out[5])!=false){
$index=$out[5];
}else{
$index=1;
}
if(isset($out2[$index])==false){
$index=$index-1;
}
if(isset($out2[$index])!==false){
$out2=$out2[$index];
if(isset($out[3])==false){
$debug.='e2'.$js;
return($js);
}
if(isset($out[7])!=false){
$index=$out[7];
}else{
$index=0;
}
$out=explode(doJS($out[3]),$out2)[$index];
return($out);
}else{
$debug.="\nWARNING:".$index." ".$context." ".$js;
return($js);
}
}
if(strpos($js,"replaceAll")!==false){
$JSdepth-=1;
if(gettype($context)!==gettype("string")){
$debug.='e'.$context.'.'.$js;
return($context.'.'.$js);
}
$out=parseJS($js,1);
$out=str_replace(doJS($out[1]),doJS($out[3]),$context);
return($out);
}
if(strpos($js,"split")!==false){
if(strpos($js,'"')!==false){
$JSdepth-=1;
if(isset(explode('"',$js)[1])==false){
return($js);
}
$list=explode('"',$js)[1];
if(isset($list)&&$list!==""&&gettype($context)=="string"){
$list=explode($list,$context);
if(strpos($js,'[')!==false){
$key=explode('[',$js)[1];
if(isset($key)==false){
return($js);
}
$key=explode(']',$key)[0];
if(isset($key)==false){
return($js);
}
try{
if(isset($list[$key])==false){
$debug.="UNIMPLEMENTED:".$js;
return("");
}
$out=$list[$key];
return($out);
}catch(Exception $e){
$output.="!?";
return($js);
}
}else{
return($list);
}
}else{
return($list);
}
}
}
if(strpos($js,"replace")!==false&&false){
if(strpos($js,'"')!==false){
$output=str_replace(doJS(explode('(',explode(')',$js)[0])[1]),$context);
$JSdepth-=1;
if(strpos($js,'[')!==false){
return($output[explode(']',explode('[',$js)[1])[0]]);
}else{
return($output);
}
}
}
if(strpos($js,"length")!==false){
$JSdepth-=1;
if(gettype($context)!=="array"){
return($context.'.'.$js);
}
$out=count($context);
return($out);
}
if(strpos($js,"at")!==false&&explode('(',$js)[0]=="at"){
if(strpos($js,'(')!==false){
$JSdepth-=1;
$pos=explode('(',explode(')',$js)[0])[1];
if(gettype($context)!=="array"){
return($context.'.'.$js);
}
if($pos<0){
$pos=count($context)-$pos-2;
}
$out=$context[$pos];
if(isset(explode(')',$js)[1])){
return($out.explode(')',$js)[1]);
}
return($out);
}
}
if(strpos($js,"indexOf")!==false){
if(strpos($js,'(')!==false){
if(gettype($context)!==gettype("string")){
$JSdepth-=1;
return($context.'.'.$js);
}
$out=parseJS($js,1);
$out=$out[(isset($out[1])?1:0)];
if(strlen($out)>0&&substr($out,0,1)=='"'&&substr($out,-1,1)=='"'){
$out=substr($out,1,-1);
}
$out=strpos($context,$out);
if($out===false){
$out=-1;
}
$JSdepth-=1;
return($out);
}else{
$JSdepth-=1;
return([$context,"indexOf"]);
}
}
$JSdepth-=1;
if(gettype($context)!=="string"){
return($js);
}
return($context.'.'.$js);
}
$tmpJS=preg_replace('/(\s*)/', "", $js);
if(isset(explode('"',$tmpJS)[2])==false||explode('"',$tmpJS)[2]==""){
$tmpJS=explode('"',$js);
$JSdepth-=1;
if(isset($tmpJS[1])!==false&&$tmpJS[1]!==""){
if($tmpJS[0]!==""){
$debug.="UNEXPECTED: ".$js;
}else{
return($tmpJS[1]);
}
}else{
if($in==$js&&is_numeric($js)==false&&$in!==""){
$debug.="\nWARNING! UNIMPLEMENTED OP: '".$in;
return("");
}
return($js);
}
}
$js2=parseJS($js,-1);
$out="";
$context="";
$conditionlist=[];
foreach($js2 as $item){
if(substr($item,-2,2)=="&&"||substr($item,-2,2)=="||"){
$context=($context?"1":"0");
}
$context=doJSthing("+",$item.$context);
$out=$context;
}
$JSdepth-=1;
if($in==$out){
$debug.="\nCAUTION, parser fault at: '".$in.".";
return("");
}
return($out);
}
function check(){
global $noElse;
global $passed;
global $elsecheck;
global $debug;
global $check;
$passed=$elsecheck;
$debug.="//not ".$passed;
if($check!=="bad value"){
$check="bad value";
if($passed===1){
$passed=0;
}else if($passed===0&&$noElse==0){
$passed=1;
}else{
$passed="?";
}
}else{
$passed="?";
}
}
$debug="";
$output="";
$script=utf8_decode("\n".'if(b.indexOf("'.$b.'")!==-1){'."\n".$script."\n}");
$temp_value=explode("\n",$script);
$temp_value=str_replace('!=-1','!==-1',$temp_value);
$skip=0;
$passed=-1;
$elsecheck="";
$conditionlist=[];
$noElse=0;
foreach($temp_value as $item){
$temp_item=$item;
if($skip>0){
$debug.="//";
if(strpos($item,"}")!==false){
$skip-=1;
$debug.="//".$skip." deep, checking:";
}
if($skip!==0){
if(strpos($item,"{")!==false){
$skip+=1;
$debug.="//".$skip." deep, skiping:";
}
}else{
$passed="?";
}
}else{
$skip=0;
}
if(strpos($item,"}")!==false&&$skip==0){
$elsecheck=array_pop($conditionlist);
}
if(strpos($item,"function writeBaV")!==false||strpos($item,"function Bto_c")!==false){
$skip=1;
}
$temp_item=explode("if(",$temp_item);
$debug.=$temp_item[0].(isset($temp_item[1])?"if(":"");
if((isset($temp_item[1])||isset(explode("}else{",$item)[1])||isset(explode("}else ",$item)[1]))&&$skip==0){
if(isset(explode("}else ",$item)[1])){
check();
}
if(isset(explode("}else{",$item)[1])){
check();
}else{
$temp_item=explode("){",$temp_item[1])[0];
$JSdepth=0;
$countparen=count(parseJS($temp_item,-1));
$check=explode("b.indexOf(",$temp_item);
$checkmulti=(isset($check[2])?$temp_item:"");
$check=(isset($check[1])?$check[1]:"");
$check=explode("||",$check)[0];
$check=explode("&&",$check)[0];
$check=explode("//",$check)[0];
$check=str_replace(')!==-1','',$check);
$check=str_replace('"','',$check);
try{
$debug.=$temp_item."\n";
$did=doJS($temp_item);
$debug.="\n".$did."\n";
if((isset(explode(")",$check)[1])==false||preg_replace('/(\s*)/', "", (explode(")",$check)[1]))!=='')&&($checkmulti==""||(strpos($item,"d.indexOf(")==false||strpos($item,"&&")==false))||$countparen<2){
$check=explode(")",$check)[0];
if(($did&&$countparen<2)||($countparen>=2&&$check!==""&&strpos($_SERVER['HTTP_USER_AGENT'],$check)!==false)){
if($did==true||$did=="true"||$did==1||$did=="1"){
$passed=1;
}else{
$passed="!";
}
}else{
$passed=0;
}
$conditionlist[]=$passed;
if($checkmulti!==""){
$check.="//not fully implemented: ".$checkmulti;
}
}else{
$passed="?";
if($checkmulti!==""){
$check.="//not implemented: ".$checkmulti;
}
}
}catch(Exception $e){
$output.="!?";
print_r($e);
}
}
if($passed!==1){
if($passed=="?"){
$debug.="//unknown";
}else{
$debug.="//false";
if(isset(explode("}else ",$item)[1])==false){
$noElse=0;
}
}
if(strpos($item,"{")!==false){
$skip=1;
$debug.="//skiping";
}
}else{
$skip=0;
$debug.="//true";
$noElse=1;
}
$debug.="\n";
}else{
if($skip==0){
if(strpos($item,"c.innerHTML+=")!==false){
$jsCode=explode("//",explode("c.innerHTML+=",$item)[1])[0];
$output.=doJS($jsCode);
}
if(strpos($item,"writeBaV(")){
$jsCode=explode("//",explode("writeBaV(",$item)[1])[0];
$jsCode=explode(")",$jsCode)[0];
$tB=explode(",",$jsCode)[0];
$tbb=explode(",",$jsCode)[1];
$tBB="";
if(isset(explode(",",$jsCode)[2])){
$tBB=explode(",",$jsCode)[2];
}
if($tbb=="1"||$tbb=="1.2"||$tbb=="2"||$tbb=="3"||$tbb=="4"||$tbb=="5"||$tbb=="3.1"||$tbb=="3.31"||$tbb=="3.334"||$tbb=="3.3"||$tbb=="3.2"||$tbb=="0"||$tbb=="0.1"){
$jsCode=explode(",",$jsCode)[0];
if($tbb=="1"||$tbb=="1.2"||$tbb=="2"||$tbb=="0"||$tbb=="0.1"){
$output.=($tbb=="2"?" ":'').str_replace('"','',$jsCode);
$tout=explode(";",explode(" ",explode(str_replace('"','',$jsCode)."/",$_SERVER['HTTP_USER_AGENT'])[1])[0])[0];
if($tbb=="1.2"){
$tout=explode(")",$tout)[0];
}
if($tbb=="2"){
$tout=explode(";",$tout)[0];
}
$jsCode=($tbb!="0.1"?":":'')." ".$tout;
$output.=$jsCode.($jsCode!==''&&$tbb!="2"?', ':"");
}else if($tbb=="3"||$tbb=="4"||$tbb=="5"||$tbb=="3.1"||$tbb=="3.31"||$tbb=="3.334"||$tbb=="3.3"||$tbb=="3.2"){
$tB=substr($tB,1,-1);
$tBB=substr($tBB,1,-1);
$output.=($tbb=="3"||$tbb=="4"?" ":'').$tB.($tbb=="3"||$tbb=="4"?" ":'');
$tout=explode(($tbb!="3.334"?" ":')'),explode($tBB,$_SERVER['HTTP_USER_AGENT'])[1])[0];
if($tbb=="3.3"){
$tout=explode(")",$tout)[0];
}
if($tbb=="3.2"||$tbb=="3.31"){
$tout=explode(";",$tout)[0];
}
if($tbb=="4"||$tbb=="3.3"){
$tout.=",";
}
$output.=$tout;
}else{
$output.="INCOMPLEATE: writeBaV(".$jsCode.")";
}
}else{
if(isset(explode(",",$jsCode)[2])==false){
$tB=substr($tB,1,-1);
$tbb=substr($tbb,1,-1);
$output.=$tB;
$tout=explode(";",explode(" ",explode($tbb,$_SERVER['HTTP_USER_AGENT'])[1])[0])[0];
$tout=explode(")",$tout)[0];
$jsCode=": ".$tout;
$output.=$jsCode.($jsCode!==''?', ':"");
}else{
$output.="UNIMPLEMENTED: writeBaV(".$jsCode.")";
}
}
}
if(strpos($item,"Temp=")&&false){
$jsCode=explode("//",explode("Temp=",$item)[1])[0];
$unusedUAtext==doJS($jsCode);
}
}
}
$debug.="\n;";
}
$temp_value=$debug;
utf8_decode($output);
if($output==""||$output==" mobile: highly falsey"||str_replace("`","",str_replace("´","",str_replace(" ","",$output)))==""){
$output=",
whoops, sorry but the php based js interpreter isn't compleate";
}
print_r('
'.$output."");
echo nl2br("\n");
$browser=explode(",",explode("``",explode(" ´ ",$output)[0])[1])[0];
if(isset(explode(": ",$browser)[1])!==false){
$browserver=explode(": ",$browser)[1];
$browser=str_replace(": ".$browserver,"",$browser);
$browserver=explode("/",$browserver);
$browserver=$browserver[count($browserver)-1];
$browser=$browser."; ".$browserver;
}
$engine=explode(",",explode("´ ",explode(" mobile:",explode(" ```",$output)[0])[0])[1])[0];
$OS=explode(",",explode("``",$output)[0])[0];
$OSver=explode(" ",$OS);
if(isset($OSver[count($OSver)-1])!==false&&$OS!==""){
$OSver=$OSver[count($OSver)-1];
$OS=str_replace(" ".$OSver,"",$OS);
$OSver=explode("/",$OSver);
$OSver=str_replace("_",".",$OSver);
$OSver=$OSver[count($OSver)-1];
$OS=$OS."; ".$OSver;
}
$device=explode(",",explode("```",$output)[1])[0];
$out=($browser!==""?$browser:"").($engine!==""?($browser!==""?" using ":"").$engine:"").($OS!==""?" on ".$OS:"").($device!==""?" on a ".$device:"");
print_r($out);
//print_r($temp_value);
file_put_contents('php/info3.html', $css."
".$temp_value);
}catch(Exception $e){
print_r($e);
}
}
$debug="";
$keys="";
$values="";
$temp_value="";
$script="";
$content="";
$content2="";
$list="";
file_put_contents('php/info2.html', $css."".str_replace('",','"'.",\n",json_encode(get_defined_vars())));
$url=$_SERVER['REQUEST_URI']!=="/lite.js";
//
?>