Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned int _rotl(const unsigned int value, int shift) {
- if ((shift &= sizeof(value) * 8 - 1) == 0)
- return value;
- return (value << shift) | (value >> (sizeof(value) * 8 - shift));
- }
- int main()
- {
- string name;
- cout << "Enter your desired name:" << endl;
- cin >> name;
- int size = name.size();
- int a = 0;
- // Additionally I am probably doing something wrong in the "key calculation" too here. Since the value at EBP-4 after the key generation is not the same as after this one.. :\
- for (int i = 0; i < size; i++)
- {
- unsigned char b = name[i];
- a += b;
- unsigned char eax = b;
- a = _rotl(a, 1);
- eax *= a;
- a = eax;
- eax = b;
- a += eax;
- a ^= b;
- }
- int c = a; //Here I have no idea what I'm doing... :@
- c ^= 0x1337C0DE;
- c -= 0xBADC0DE5;
- //c ^= -1;
- //a ^= c;
- cout << "Your serial is: " << c << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement