Advertisement
Guest User

Untitled

a guest
Jul 1st, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. main()
  6. {
  7. FILE *fp = fopen("user.pswd.txt","r");
  8. if(fp==NULL)
  9. {
  10. printf("file not found.\n");
  11. exit(EXIT_FAILURE);
  12. }
  13.  
  14. char *first, *last, *bytes, *user, *pass, *line;
  15. char *username, *password;
  16. int retry = 3;
  17. printf("Attempting to login to protected system, please login to your account.\n");
  18. while(retry)
  19. {
  20. printf("username: ");
  21. scanf("%s", user);
  22. printf("password: ");
  23. scanf("%s", pass);
  24.  
  25. while(fscanf(fp, "%[^\n]\n", first) != EOF)
  26. {
  27. printf("OH MY FUCKIGN GOOOOD PRIIIIIIINT\n");
  28. printf("\"%s\"\n",first);
  29. /*
  30. if(strcmp(user,username) && strcmp(pass,password))
  31. {
  32. printf("Hello, %s! You are currently using %dKB of storage.\n", first);
  33. fclose(fp);
  34. exit(EXIT_SUCCESS);
  35. }*/
  36. }
  37.  
  38. printf("Login failed. %d attempts left.\n", --retry);
  39. }
  40.  
  41. fclose(fp);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement