Advertisement
Guest User

Untitled

a guest
Sep 12th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unsigned int _rotl(const unsigned int value, int shift) {
  2.     if ((shift &= sizeof(value) * 8 - 1) == 0)
  3.         return value;
  4.     return (value << shift) | (value >> (sizeof(value) * 8 - shift));
  5. }
  6.  
  7. int main()
  8. {
  9.     string name;
  10.     cout << "Enter your desired name:" << endl;
  11.     cin >> name;
  12.     int size = name.size();
  13.  
  14.     int a = 0;
  15.     // 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.. :\
  16.     for (int i = 0; i < size; i++)
  17.     {
  18.         unsigned char   b = name[i];
  19.         a += b;
  20.         unsigned char eax = b;
  21.         a = _rotl(a, 1);
  22.         eax *= a;
  23.         a = eax;
  24.         eax = b;
  25.         a += eax;
  26.         a ^= b;
  27.     }
  28.     int c = a;  //Here I have no idea what I'm doing... :@
  29.     c ^= 0x1337C0DE;
  30.     c -= 0xBADC0DE5;
  31.     //c ^= -1;
  32.     //a ^= c;
  33.     cout << "Your serial is: " << c << endl;
  34.     system("pause");
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement