直接贴出注册机
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name = "CTFHUB";
char name2[20];
char cl;
int al = 5,edx=0;
while (al > 0) {
cl = name[edx];
cl = cl ^ 0x29;
cl = cl + al;
if ((cl < 'A') | (cl > 'Z')) {
cl = 0x52;
cl = cl + al;
}
name2[edx] = cl;
name2[edx + 1] = 0;
++edx;
--al;
}
cout << name2 << endl;
al = 5;
edx = 0;
while (al > 0) {
cl = name[edx];
cl = cl ^ 0x27;
cl = cl + al;
++cl;
if ((cl < 'A') | (cl > 'Z')) {
cl = 0x4d;
cl = cl + al;
}
name2[5 + edx] = cl;
name2[6 + edx] = 0;
++edx; --al;
}
cout << name2 << endl;
string key="........................";
int i = 0;
char bl, dl;
while (name2[i] != 0) {
dl = name2[i];
dl = dl + 5;
if (dl > 'Z') {
dl = dl - 0xD;
dl = dl ^ 0xC;
if (dl < 'A') {
dl = 0x4B;
dl = dl + i;
}
else if (dl > 'Z') {
dl = 0x4B;
dl = dl - i;
}
}
else {
dl = dl ^ 0xC;
if (dl < 'A') {
dl = 0x4B;
dl = dl + i;
}
else if (dl > 'Z') {
dl = 0x4B;
dl = dl - i;
}
}
key[i] = dl;
i++;
}
cout << key << endl;
return 0;
}
|