- $contents = file_get_contents('http://chengdu.baixing.com/diannaopeijian/a126971585.html');
- preg_match('/var _ = (.+?)\+0;/is', $contents, $tmp);
- $_ = decode_($tmp[1]);
- preg_match('/code="(.+?)"/is', $contents, $tmp);
- $code = $tmp[1];
- function decode_($_)
- {
- $_ = str_replace('-~[]<<(', 'pow(2, ', $_);
- $_ = preg_replace('/(-~[^\*|^+]*)/', '(\\1)', $_);
- $_ = str_replace(array('____', '___', '__', '-~', '[]'), array('$_4','$_3','$_2', '1+', 0), $_);
- return eval('return '.$_.';');
- }
- function decodeMobile($g, $f)
- {
- $h='';
- $b = explode('%',substr($g,1));
- foreach($b as & $a)
- {
- $a = intval($a, 1 << (1 << 1 << 1));
- }
- while (count($b) > 0)
- {
- $d = 0;
- foreach($b as & $a)
- {
- $t = $a+$d*$f;
- $a = intval($t/(1 << (1 << 3)));
- $d = $t % (1 << (1 << 3));
- }
- if ($d < 16)
- {
- $h = "%0". dechex($d) . $h;
- } else
- {
- $h = "%" . dechex($d) . $h;
- }
- foreach($b as & $a)
- {
- if($a == 0 && count($b)>0)
- {
- array_shift($b);
- }else
- {
- break;
- }
- }
- }
- return $h;
- }
- echo 'http://static.baixing.net/pages/mobile.php?c='.decodeMobile($code,$_).'/3.jpg';
复制代码 看到论坛里另外两个高手玩的都是PYTHON,小弟献丑,玩玩PHP, 如有BUG,请指出,
由于电话只有0-9组成,做简单的OCR也是很好办的,改天再说吧 |