Guest User

Untitled

a guest
Feb 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. int main(int argc, string argv[]) {
  2. string hash = argv[1]; // Read from argv
  3. crack_password(hash);
  4. }
  5.  
  6. void crack_password(char * hash) {
  7. printf("%dn", hash) // prints correctly.
  8. string * password_guess = // some functionality, hash doesn't change
  9. match_password(password_guess, hash);
  10. }
  11.  
  12. match_password(char * password_guess, char * hash) {
  13. printf("%dn", hash) // prints correctly.
  14. char first_two_letters[2] = "";
  15. append(first_two_letters, hash[0]);
  16.  
  17. printf("Hash: %sn", hash);
  18. append(first_two_letters, hash[1]);
  19. printf("%dn", first_two_letters) // prints first two letters of the hash.
  20. printf("%dn", hash) // hash null here.
  21. }
  22.  
  23. void append(char* s, char c) {
  24. int len = strlen(s);
  25. s[len] = c;
  26. s[len+1] = '';
  27. }
Add Comment
Please, Sign In to add comment