So here is simple program that checks every password with 4 characters, it starts with aaaa,aaab,aaac,aaad....aaba,aaca,aada.... and so on. To check for every of those combinations I used loop inside loop inside loop... user->passsword is password of user that we are trying to find with this sea of loops.
CODE LOOKS LIKE THIS:
I'm gonna analyse this a little bit but thanks man that should be it.
Here is my answer for future generations:
1 2 3 4 5 6 7 8 9 10 11
void Hack(string &guess_String, string target_String, int string_size) {
for (char current_letter = 'a'; current_letter < 'z' + 1; current_letter++) { //loop for every letter <-------------------------------------------
if (guess_String == target_String) //if strings are same exit this and every resursion loop |
return; // |
if (string_size > 0) { //check every digit until diget is on 0 place (awfx)->(0123) |
guess_String[string_size - 1] = current_letter; // |
cout << "Checking..." << guess_String << "=" << target_String << endl; // |
Hack(guess_String, target_String, string_size - 1); //check every digit for one place on left for every letter on right |
}
}
}