- UID
- 10919
注册时间2006-4-18
阅读权限10
最后登录1970-1-1
周游历练
该用户从未签到
|
发表于 2006-10-24 17:28:57
|
显示全部楼层
我的注册机
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("Usage: CrackMeKey.exe <UserName>");
return 0;
}
unsigned int UserNameLen = strlen(argv[1]);
char *key = new char[UserNameLen];
char *UserName = new char;
for (unsigned int i = 0;i < strlen(argv[1]); ++i)
*(UserName + i) = *(argv[1] + i);
*(UserName + UserNameLen) = '\0';
char list1[] = "A1LSK2DJF4HGP3QWO5EIR6UTYZ8MXN7CBV9";
char list2[] = "SU7CSJKF09NCSDO9SDF09SDRLVK7809S4NF";
if ((UserNameLen > 8) || (UserNameLen < 1))
{
printf("用户名必须小于8个字符!!\n");
return 0;
}
unsigned int x = 0;
for (;x < UserNameLen; ++x)
{
if (*(UserName + x) < 'A' || (*UserName + x > 'z'))
{
printf("用户名只能是字母和\"[\\]^_`\"!!!\n");
return 0;
}
if (*(UserName + x) > 'Z')
*(UserName + x) -= 32;
unsigned int y = 0;
for (; y < strlen(list1); ++y)
{
if (*(UserName + x) == list1[y])
{
key[x] = list2[y];
break;
}
}
}
key[UserNameLen] = '\0';
printf("The key of %s is %s",argv[1],key);
delete [] key;
delete UserName;
return 1;
} |
|