home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / AFR.ARJ / AFR.C next >
Encoding:
C/C++ Source or Header  |  1996-06-14  |  850 b   |  48 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. typedef unsigned char BYTE;
  5. typedef unsigned int  WORD;
  6. typedef unsigned long DWORD;
  7.  
  8. static BYTE Key[] = {
  9.     0x84, 0x9b, 0xb9, 0xcd,
  10.     0x21, 0x6b, 0xdb, 0xf4,
  11.     0x5b, 0xec, 0x51, 0x32,
  12.     0x00
  13. };
  14.  
  15. void GenKey( BYTE *Buf )
  16. {
  17.     WORD nTmp, nLen;
  18.     BYTE i, j, t1, t2;
  19.  
  20.     nLen = strlen( Buf );
  21.     t1 = 0;
  22.     for( i = 0; i < nLen; i ++ ){
  23.         t2 = Buf[ i ] ^ 0x12;
  24.         for( j = 0; j < 0xc; j ++ ){
  25.             nTmp = t2 + Key[ j ];
  26.             if( nTmp > 0xff ) nTmp ++;
  27.             Key[ j ] = nTmp ^ 0x34 ^ t1;
  28.             t1 = Key[ j ];
  29.         }
  30.     }
  31. }
  32.  
  33. void main( void )
  34. {
  35.     BYTE    bName[ 128 ], i;
  36.  
  37.     printf( "AFR --- AllFix 4.33 Register\n" );
  38.  
  39.     printf( "Enter you Name: " );
  40.     gets( bName );
  41.  
  42.     GenKey( bName );
  43.  
  44.     printf( "Your Register Key is:" );
  45.     for( i = 0; i < 0xc; i ++ ) printf( " %02X", Key[ i ] );
  46.     printf( ".\n" );
  47. }
  48.