Advertisement
Guest User

Untitled

a guest
Dec 21st, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. void nullkey(void)
  6. {
  7.     printf("%sType: ./CrackMe <password>%s\n");
  8.     exit(1);
  9. }
  10.  
  11. void youwin(void)
  12. {
  13.     printf("%sYou win!%s\n");
  14.     exit(1);
  15. }
  16.  
  17. int main(int argc, char *argv[])
  18. {
  19.     if (argv[1] == NULL) nullkey();
  20.  
  21.     char keytrue[] = "tfoib";
  22.     char *key = argv[1];
  23.     char *keystorage;
  24.    
  25.     int i;
  26.     for (i=0; i<strlen(keytrue); i++) keytrue[i]--;
  27.     keystorage = keytrue;
  28.  
  29.     if (strcmp(keystorage,key) == 0 ) { youwin(); } else { printf("%sChave invalida!\n%s"); }
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement