能力值:
(RANK:170 )
|
-
-
2 楼
Pass!!
|
能力值:
( LV15,RANK:2473 )
|
-
-
3 楼
//想出一种不用递归的方法:
DWORD MsGen(HWND hDlg)
{
char szName[0x100];
char szCode[0x400];
int Len;
int i;
int K;
DWORD N;
if (Len = GetDlgItemText(hDlg, IDC_EDIT_NAME, szName, 16))
{
K = 0x13572468;
for (i=0;i<Len;i++)
{
K = (K + szName[i]) * 0x3721273 + 0x24681357;
K = (K << 0x19) | (K >> 7);
}
Len = 0;
do
{
Len++;
} while((Len ^ (Len >> 1)) != (WORD)((K >> 1) & 0xFF | 0x100));
for (i=0;i<Len;i++)
{
N = Len - i;
N ^= N - 1;
N ^= N >> 1;
__asm
{
bsf eax,N
mov N,eax
}
szCode[i] = ((BYTE)(N + 11 - (((DWORD)K >> (i % 31)) % 10)) % 10) + 0x30;
}
szCode[Len] = 0;
SetDlgItemText(hDlg, IDC_EDIT_CODE, szCode);
}
return 1;
}
|
|
|