flashfxp解密
amxku's blogamxku PS:一个是7j写的,一个是国外的,相比之下,国外的那个东,速度要快一些,7J可能该郁闷了。呵呵,学习学习。 function flashfxp($data)<br />
{<br />
$pass=substr($data, 2);
<br />
$flashfxp_key = array(y,0,A,0,3,0,6,0,z,0,A,0,4,0,8,0,d,0,E,0,h,0,f,0,r,0,v,0,g,0,h,0,G,0,R,0,g,0,5,0,7,0,h,0,5,0,U,0,l,0,D,0,v,0,3);
<br />
for ($i=0; $i < strlen($data) - 2; $i =2)<br />
{<br />
$run = (Hexdec(substr($pass, $i, 2)) ^ Hexdec(DecHex(ord($flashfxp_key[$i])))) - Hexdec(substr($data, $i, 2));
<br />
if ($run < 0)<br />
$run=$run 255;
<br />
$Num.=chr($run);<br />
}
<br />
return $Num;<br />
} <br />
国外的一个 function decryptffxp($ciphertext)<br />
{<br />
$magic_buffer="yA36zA48dEhfrvghGRg57h5UlDv3";<br />
$count =0;<br />
$length =strlen($ciphertext);
<br />
while ($count < $length)<br />
{<br />
$cts.=chr(hexdec($ciphertext[$count] . $ciphertext[$count 1]));<br />
$count =2;<br />
}
<br />
$length =strlen($cts);<br />
$count =0;<br />
$mbcount=0;
<br />
while ($count 1 < $length)<br />
{<br />
$foo = ord($cts[$count 1]) ^ ord($magic_buffer[$mbcount]);
<br />
if ($foo - ord($cts[$count]) < 0)<br />
{<br />
$plaintext.=chr($foo - ord($cts[$count]) 255);<br />
}<br />
else<br />
{<br />
$plaintext.=chr($foo - ord($cts[$count]));<br />
}
<br />
$count;<br />
$mbcount;
<br />
if ($mbcount == 28)<br />
{<br />
$mbcount=0;<br />
}<br />
}
<br />
return $plaintext;<br />
}
<br />
頁:
[1]