/******************************************************************************/
/* */
/* Microsoft Visual C++ 6.0 MFC --> KeygenDlg.cpp */
/* */
/* Microsoft Windows XP Professional Service Pack 2 编译通过 */
/* */
/******************************************************************************/
void CKeygenDlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData (true) ;
int Box1[8]={0,0,0,0,0,0,0,0} , Box2[8]={0,0,0,0,0,0,0,0} ;
int i , j = 0 , n , Result1 = 0 , Result2 = 0 ;
char MCode[256];
m_Edit2 = "" ;
n = m_Edit1.GetLength ();
strcpy(MCode,m_Edit1);
for ( i = 0 ; i < n ; i++ ){
Box1[j] = ( MCode[i] + Box1[j] ) ^ 0x12 ;
Result1 += Box1[j] ;
j++ ;
if ( j == 8 ) j = 0 ;
}
for ( i = 0 ; i < 22 ; i++ ){
Box2[j] = ( MCode2[i] + Box2[j] ) ^ 0x19 ;
Result2 += Box2[j] ;
j++ ;
if ( j == 8 ) j = 0 ;
}