index.php代码 [code] <title>查询echo $_GET["url"];?>pr</title> <form method="GET"> <input name="url"> <input type="submit" value="Get PageRank"> </form> if(!empty($_GET["url"])) { include "google_pagerank.php"; print "不包含http://<BR><a href='http://".$_GET["url"]."'>".$_GET["url"]."</a>的pr是 ".(int)getrank($_GET["url"])." "; } ?> [/code] google_pagerank.php的代码 [code] /* Google PR v2.0 author zhil ([email protected]) GoogleToolbar 2.0.111-big */ function fadd($v1,$v2) { $v3 = $v1 + $v2; if($v3 > 4294967295)$v3 = $v3 - 4294967296; // print $v3."<BR>"; return $v3; } function fsub($v1,$v2) { $v3 = $v1 - $v2; if($v3 < 0 )$v3 = $v3 + 4294967296; if($v3 > 4294967295)$v3 = $v3 - 4294967296; // print $v3."<BR>"; return $v3; } function fdl($v1,$v2) { // if($v1 > 2147483647){$v1 = 2147483647;$v2++;} $v3 = $v1 << $v2; while($v3 > 4294967295)$v3 = $v3 - 4294967296; return $v3; } function fdr($v1,$v2) { if($v1 > 2147483647){$v1 = floor($v1/2);$v2--;} $v3 = $v1 >> $v2; // while($v3 > 4294967295)$v3 = $v3 - 4294967296; return $v3; } function fxr($v1,$v2) { $v3 = $v1 ^ $v2; while($v3 > 4294967295)$v3 = $v3 - 4294967296; while($v3 < 0)$v3 = $v3 + 4294967296; return $v3; } function z($var) { GLOBAL $$var; print $var." = ".$$var."<HR>"; } function get_ch($url) { $c1 = 0xE6359A60; $c2 = 0x9E3779B9; $url = "info:".$url; //z('url'); // uint $_eax, $_edi, $_ecx, $_edx, _esi, $_edi; // uint _var8, _var4; $_var4 = strlen($url); GLOBAL $_eax,$_ebx,$_ecx,$_edx,$_edi,$_esi; $_esi = $c1; $_edi = $_ebx = $c2; if ($_var4 > 11) // goto loc_1002FCD6; { $_var8 = floor($_var4 / 12); $_ecx = 0; //loc_1002FBFB: while($_var8 > 0) { $_eax = ord($url[(int)($_ecx+0x7)]); $_edx = ord($url[(int)($_ecx+0x6)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x5)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x4)]); $_edx = fadd($_edx,$_edi); $_eax = fdl($_eax,8); $_edi = fadd($_edx,$_eax); $_eax = ord($url[(int)($_ecx+0xB)]); $_edx = ord($url[(int)($_ecx+0xA)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x9)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x8)]); $_edx = fadd($_edx,$_esi); $_eax = fdl($_eax,8); $_esi = fadd($_edx,$_eax); $_edx = ord($url[(int)($_ecx+0x3)]); $_eax = ord($url[(int)($_ecx+0x2)]); $_edx = fdl($_edx,8); $_edx = fadd($_edx,$_eax); $_eax = ord($url[(int)($_ecx+0x1)]); $_edx = fdl($_edx,8); $_edx = fadd($_edx,$_eax); $_eax = ord($url[(int)($_ecx+0x0)]); $_edx = fdl($_edx,8); $_edx = fadd($_edx,$_eax); $_edx = fsub($_edx,$_edi); $_edx = fsub($_edx,$_esi); $_eax = $_esi; $_eax = fdr($_eax,13); $_edx = fadd($_edx,$_ebx); $_edx = fxr($_edx,$_eax); $_edi = fsub($_edi,$_edx); $_edi = fsub($_edi,$_esi); $_eax = $_edx; $_eax = fdl($_eax,8); $_edi = fxr($_edi,$_eax); $_esi = fsub($_esi,$_edi); $_esi = fsub($_esi,$_edx); $_eax = $_edi; $_eax = fdr($_eax,13); $_esi = fxr($_esi,$_eax); $_edx = fsub($_edx,$_edi); $_edx = fsub($_edx,$_esi); $_eax = $_esi; $_eax = fdr($_eax,12); $_edx = fxr($_edx,$_eax); $_edi = fsub($_edi,$_edx); $_edi = fsub($_edi,$_esi); $_eax = $_edx; $_eax = fdl($_eax,16); $_edi = fxr($_edi,$_eax); $_esi = fsub($_esi,$_edi); $_var4 -= 12; $_esi = fsub($_esi,$_edx); $_eax = $_edi; $_eax = fdr($_eax,5); $_esi = fxr($_esi,$_eax); $_edx = fsub($_edx,$_edi); $_eax = $_esi; $_eax = fdr($_eax,3); $_edx = fsub($_edx,$_esi); $_edx = fxr($_edx,$_eax); $_ebx = $_edx; $_edi = fsub($_edi,$_ebx); $_edi = fsub($_edi,$_esi); $_eax = $_ebx; $_eax = fdl($_eax,10); $_edi = fxr($_edi,$_eax); $_esi = fsub($_esi,$_edi); $_eax = $_edi; $_esi = fsub($_esi,$_ebx); $_eax = fdr($_eax,15); $_esi = fxr($_esi,$_eax); $_ecx += 12; // z('_eax');z('_ebx');z('_ecx');z('_edx');z('_edi');z('_esi');die(); $_var8 --; } }else { $_ecx = 0; } //loc_1002FCD9: $_esi += strlen($url); $_eax = $_var4; $_eax --; if ($_eax < 11)// goto loc_1002FD81; { /* switch ($_eax) { case 0x0: break; case 0x1: break; case 0x2: break; case 0x3: break; case 0x4: break; case 0x5: break; case 0x6: break; case 0x7: break; case 0x8: break; case 0x9: break; case 0xA: break; }*/ //loc_1002FCF0: // case 0xa if($_eax == 0xa) { $_eax = ord($url[(int)($_ecx+0xA)]); $_eax = fdl($_eax,24); $_esi = fadd($_esi,$_eax); $s1 = true; } //loc_1002FCF9: // case 0x9 if(($_eax == 0x9)||$s1) { $_eax = ord($url[(int)($_ecx+0x9)]); $_eax = fdl($_eax,16); $_esi = fadd($_esi,$_eax); $s2 = true; } //loc_1002FD02: // case 0x8 if(($_eax == 0x8)||$s2) { $_eax = ord($url[(int)($_ecx+0x8)]); $_eax = fdl($_eax,8); $_esi = fadd($_esi,$_eax); $s3 = true; } //loc_1002FD0B: // case 0x7 if(($_eax == 0x7)||$s3) { $_eax = ord($url[(int)($_ecx+0x7)]); $_edx = ord($url[(int)($_ecx+0x6)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x5)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x4)]); $_eax = fdl($_eax,8); $_edx = fadd($_edx,$_edi); $_edi = fadd($_edx,$_eax); $g1 = true; //goto loc_1002FD47; } //loc_1002FD2F: // case 0x6 if(($_eax == 0x6)) { $_eax = ord($url[(int)($_ecx+0x6)]); $_eax = fdl($_eax,16); $_edi = fadd($_edi,$_eax); $s5 = true; } //loc_1002FD38: // case 0x5 if(($_eax == 0x5)||$s5) { $_eax = ord($url[(int)($_ecx+0x5)]); $_eax = fdl($_eax,8); $_edi = fadd($_edi,$_eax); $s6 = true; } //loc_1002FD41: // case 0x4 if(($_eax == 0x4)||$s6) { $_eax = ord($url[(int)($_ecx+0x4)]); $_edi = fadd($_edi,$_eax); $s7 = true; } //loc_1002FD47: // case 0x3 if(($_eax == 0x3)||$g1||$s7) { $_eax = ord($url[(int)($_ecx+0x3)]); $_edx = ord($url[(int)($_ecx+0x2)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_edx = ord($url[(int)($_ecx+0x1)]); $_ecx = ord($url[(int)($_ecx+0x0)]); $_eax = fdl($_eax,8); $_eax = fadd($_eax,$_edx); $_eax = fdl($_eax,8); $_ecx = fadd($_ecx,$_ebx); $_ebx = fadd($_ecx,$_eax); $g2 = true; } //loc_1002FD6A: // case 0x2 if($_eax == 0x2) { $_eax = ord($url[(int)($_ecx+0x2)]); $_eax = fdl($_eax,16); $_ebx = fadd($_ebx,$_eax); $s8 = true; } //loc_1002FD73: // case 0x1 if(($_eax == 0x1)||$s8) { $_eax = ord($url[(int)($_ecx+0x1)]); $_eax = fdl($_eax,8); $_ebx = fadd($_ebx,$_eax); $s9 = true; } if(($_eax == 0x0)||$s9) { //loc_1002FD7C: // case 0x0 $_eax = ord($url[(int)($_ecx+0x0)]); $_ebx = fadd($_ebx,$_eax); } } //loc_1002FD81: // default $_ebx = fsub($_ebx,$_edi); $_ebx = fsub($_ebx,$_esi); $_eax = $_esi; $_eax = fdr($_eax,13); $_ebx = fxr($_ebx,$_eax); $_edi = fsub($_edi,$_ebx); $_edi = fsub($_edi,$_esi); $_eax = $_ebx; $_eax = fdl($_eax,8); $_edi = fxr($_edi,$_eax); $_esi = fsub($_esi,$_edi); $_esi = fsub($_esi,$_ebx); $_eax = $_edi; $_eax = fdr($_eax,13); $_esi = fxr($_esi,$_eax); $_ebx-= $_edi; $_ebx = fsub($_ebx,$_esi); $_eax = $_esi; $_eax = fdr($_eax,12); $_ebx = fxr($_ebx,$_eax); $_edi = fsub($_edi,$_ebx); $_edi = fsub($_edi,$_esi); $_eax = $_ebx; $_eax = fdl($_eax,16); $_edi = fxr($_edi,$_eax); $_esi = fsub($_esi,$_edi); $_eax = $_edi; $_esi = fsub($_esi,$_ebx); $_eax = fdr($_eax,5); $_esi = fxr($_esi,$_eax); $_ebx = fsub($_ebx,$_edi); $_eax = $_esi; $_ecx = $_eax; $_ebx = fsub($_ebx,$_eax); $_ecx = fdr($_ecx,3); $_ebx = fxr($_ebx,$_ecx); $_edi = fsub($_edi,$_ebx); $_edi = fsub($_edi,$_eax); $_ecx = $_ebx; $_ecx = fdl($_ecx,0xA); $_edi = fxr($_edi,$_ecx); $_eax = fsub($_eax,$_edi); $_eax = fsub($_eax,$_ebx); $_edi = fdr($_edi,0xF); $_eax = fxr($_eax,$_edi); return "6".$_eax; } function getrank($url) { ob_start(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://66.102.11.104/search?client=navclient-auto&ch=".get_ch($url)."&ie=UTF-8&oe=UTF-8&features=Rank&q=info:".$url); // print get_ch($url);die(); // curl_setopt($ch, CURLOPT_URL, "http://66.102.11.104/search?client=navclient-auto&ch=6517667070&ie=UTF-8&oe=UTF-8&features=Rank&q=info:http://www.skinz.org"); // http:///search?client=navclient-auto&ch=6517667070&ie=UTF-8&oe=UTF-8&features=Rank&q=info:http%3A%2F%2Fwww%2Eskinz%2Eorg curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; GoogleToolbar 2.0.102-big; Windows XP 5.1)"); curl_exec($ch); curl_close($ch); $content = ob_get_contents(); ob_end_clean(); // print $content; return substr($content,(strrpos($content,":")+1)); } ?> [/code] |