int main(int argc, char *argv[]) { int n, test_result; char c, command[CACHE_MAX], password[CACHE_MAX], password_16[CACHE_MAX]; strcpy(password_16, "1234567890123456"); for (n = 0; n < 14; n++) { for (c = 'a'; c <= 'z'; c++) { password_16[n] = c; if (test_password(password_16) == 0) { password_16[n] = c - 1; break; } } strncpy(password, password_16, n + 1); password[n] = password[n] + 1; password[n + 1] = '\0'; if (test_password(password) == 1) { printf("Password: %s\n", password); snprintf(command, sizeof(command), "/home/alice/Public/admin-secret %s", password); system(command); break; } } return 0; }
static int put_password(string str) { // string bing; string playername; playername = this_player()->query_name(); if (!str || str == "") { write("Sin contraseña no puedes retirarte.\n"); return 0; } if (!test_password(playername, str)) { write("Contraseña equivocada, no puedes retirarte.\n"); return 0; } do_retirejob(playername); return 1; } /* put_password() */