Advertisement
AI_UBI

The Brute algorithm

Apr 12th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1.  
  2. void algorithm(unsigned char s, unsigned char e, const unsigned l)
  3. {
  4.     bool end = false;
  5.     unsigned cell = 0;
  6.     unsigned char *password = new unsigned char[l];
  7.  
  8.     memset(password, '\r', l);
  9.  
  10.     while (!end)
  11.     {
  12.         if (password[cell] < e)
  13.         {
  14.             if (password[cell] < s) password[cell] = s; //Here shit
  15.             ++password[cell];
  16.         }
  17.         if (password[cell] == e && cell < l)
  18.         {
  19.             link: //While, yep, but.. GOTO IS NOT TO BAD
  20.  
  21.             while (password[cell] == e)
  22.             {
  23.                 ++cell;
  24.                 if (cell == l && password[cell]) return;
  25.  
  26.                 password[cell - 1] = s;
  27.             }
  28.  
  29.             ++password[cell]; //if we move it out while we ... THOUGHT HAS BEEN LOSE.
  30.  
  31.             if (password[cell] < s) password[cell] = s; //And here shit too
  32.            
  33.             while(cell > 0 && password[cell - 1] < e) --cell;          
  34.         }
  35.     }
  36.    
  37.     delete[] password;
  38. }
  39.  
  40. //Here you can see piece of shit.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement