Advertisement
Guest User

Untitled

a guest
Sep 12th, 2015
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. unsigned int _rotl(const unsigned int value, int shift) {
  7.     if ((shift &= sizeof(value) * 8 - 1) == 0)
  8.         return value;
  9.     return (value << shift) | (value >> (sizeof(value) * 8 - shift));
  10. }
  11.  
  12. int main()
  13. {
  14.     string name;
  15.     cout << "Enter your desired name:" << endl;
  16.     cin >> name;
  17.     int size = name.size();
  18.  
  19.     int a = 0;
  20.     for (int i = 0; i < size; i++)
  21.     {
  22.         unsigned char   b = name[i];
  23.         a += b;
  24.         int eax = (int)b;
  25.         a = _rotl(a, 1);
  26.         eax *= a;
  27.         a = eax;
  28.         eax = b;
  29.         a += eax;
  30.         a ^= b;
  31.     }
  32.     int c = a;
  33.     c ^= -1;
  34.     c += 0xBADC0DE5;
  35.     c ^= 0x1337C0DE;
  36.    
  37.     cout << "Your serial is: " << c << endl;
  38.     system("pause");
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement