[C++] 纯文本查看 复制代码
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
void main()
{
unsigned char base[] = {
0x70, 0x18, 0xEB, 0x66, 0xB2, 0x25, 0xEB, 0x62, 0xB2, 0x42, 0xEB, 0x5E, 0xB2, 0x0C, 0xEB, 0x5A,
0xB2, 0x0D, 0xEB, 0x56, 0xB2, 0x06, 0xEB, 0x52, 0xB2, 0x36, 0xEB, 0x4E, 0xB2, 0x2B, 0xEB, 0x4A,
0xB2, 0x17, 0xEB, 0x46, 0xB2, 0x2F, 0xEB, 0x42, 0xB2, 0x13, 0xEB, 0x3E, 0xB2, 0x82, 0xEB, 0x3A,
0xB2, 0x9B, 0xEB, 0x36, 0xB2, 0x92, 0xEB, 0x32, 0xB2, 0x03, 0xEB, 0x2E, 0xB2, 0x63, 0xEB, 0x2A,
0xB2, 0x21, 0xEB, 0x26, 0xB2, 0x42, 0xEB, 0x22, 0xB2, 0x5C, 0xEB, 0x1E, 0xB2, 0x29, 0xEB, 0x1A,
0xB2, 0xC7, 0xEB, 0x16, 0xB2, 0x66, 0xEB, 0x12, 0xB2, 0x58, 0xEB, 0x0E, 0xB2, 0x0A, 0xEB, 0x0A,
0xB2, 0x28, 0xEB, 0x06, 0xB2, 0x50, 0xEB, 0x02, 0xB2, 0x5D};
unsigned char key1 = 0x5D;
unsigned char tmp;
char * yourName;
yourName = new char[260];
memset(yourName, 0, 260);
cout << "Enter your name:";
gets(yourName);
if (strlen(yourName) < 6)
{
cout << "your name less then 6!" << endl;
system("pause");
return;
}
for (int x = 0; x < 5; x++)
{
tmp = yourName[x] - 97;
if (tmp> 0x19)
key1 += 0x5D;
else
key1 += base[tmp * 4 +1];
}
cout << "serial is:" << 0 + key1 << "-" << strlen(yourName) * 0x4A7E << endl;
system("pause");
}