越简单越好!

WinWebMail注册计算程序(PHP版)

发表于 2009-08-08 16:37 | 1369次阅读 0次点赞   PHP

把以下文件用记事本保存起来,再改名wwm.php 上传到支持php的空间就可以使用了,仅仅支持250用户和无限用户的注册码算法!仅供学习使用,请勿用在商业用途!

<?php
error_reporting(E_ALL);

$HexTable = array( 0xFF924F3F,0x3E543657,0xFFFFDB61,    
                   0x80000062,0x40000020,0x10000002,
                   0x7FFFFFFF,0x3FFFFFFF,0x0FFFFFFF,
                   0x80000000,0xC0000000,0xF0000000);                 
main();

                   
                   
          
function ConvertChar($CByte)          
{        
global $HexTable;

$Flag1 = $HexTable[1] & 1;          
$Flag2 = $HexTable[2] & 1;    
$localChar = 0;

for($i=8; $i>0; $i--)
{     
    if( $HexTable[0]%2 != 0 )
    {
      $HexTable[0] = (($HexTable[0]^$HexTable[3])>>1) | $HexTable[9];
      if( $HexTable[1]%2 != 0)
      {
         $HexTable[1] = (($HexTable[1]^$HexTable[4])>>1) | $HexTable[10];
         $Flag1 = 1;
      }
      else
      {
         $HexTable[1] = ($HexTable[1]>>1) & $HexTable[7];
         $Flag1 = 0;
      } 
    } 
    else
    { 
      $HexTable[0] = ($HexTable[0]>>1) & $HexTable[6];
      if( $HexTable[2] %2 !=0)
      {
         $HexTable[2] = (($HexTable[2]^$HexTable[5])>>1 )| $HexTable[11];
         $Flag2 =1;
      }
      else
      {
         $HexTable[2] = ($HexTable[2]>>1) & $HexTable[8];
         $Flag2 =0;
      }
    }
    $localChar = ($localChar <<1) | ($Flag1 ^ $Flag2);
}

$TempInt = $localChar ^ ord($CByte);
return ($TempInt==0)?$localChar : $TempInt;    
}




function KeyGen($MACAddress)
{
   $output = md5($MACAddress);
   $len = strlen($output);
   $MD5String= array();
   
   for ($i = 0; $i < $len; $i++)
   {
     $MD5String[$i] = substr($output,$i,1);
   }   
   for( $i = 0; $i < $len; $i++ )
   {
     $MD5String[$i] = ConvertChar($MD5String[$i]);
   }
   
   $TempString = chr($MD5String[0]);
   for( $i = 1; $i < $len; $i++ )
   {
     $TempString .= chr($MD5String[$i]);
   } 
   $output = md5($TempString);
   
   echo "RegCode:<font color=brown>".$output."</font><br><br>";
   echo "© 2004 <a href='http://blacklist.ideacm.cn'>CNlive.ORG</a>";
   echo "      <a href='http://blacklist.ideacm.cn'>NOTE</a>";
}



function main()
{
   $mac_invalid = '';
   //if (array_key_exists("mac", $_POST) )
   if ( isset($_POST['mac']) )
   {
      if ( strlen($_POST['mac'])==19 && ereg("[0-9](-[0-9A-F]{2}){6}",$_POST['mac']) )
      {
         $MacAddress = $_POST['mac'];
         KeyGen($MacAddress); 
         exit(0);
      } 
      else
         $mac_invalid = "<br><br><font color=red>Your MAC is invalid</font>,please input it again.<br><br>";
   }

echo "<html><head><title> DiyWay.Net::WinWebMail Keygen</title></head>";
echo "<body>WinWebMail Keygen";
echo $mac_invalid;
echo "<form action='' method='post'>";
echo "<br>NIC MAC:<input name='mac' type='text' size=28>";
echo "<input name='submit' type='submit' value='OK'></form>";

}

WinWebMail 3.7.7.3 下测试可用
?>


返回顶部 ^