Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. char key[20] = { 0x87, 0xff, 0x63, 0xa3, 0x8d, 0x75, 0xd8, 0xc4, 0x1a, 0x84, 0xca, 0x24, 0x5b, 0x66, 0x0c, 0x1f, 0xc6, 0xe2, 0xcc, 0xea };
  7.  
  8. FILE *fileptr;
  9. char *buffer;
  10. long filelen;
  11.  
  12. fileptr = fopen("flag.enc", "rb");
  13. fseek(fileptr, 0, SEEK_END);
  14. filelen = ftell(fileptr);
  15. rewind(fileptr);
  16.  
  17. buffer = (char *)malloc((filelen+1)*sizeof(char));
  18. fread(buffer, filelen, 1, fileptr);
  19. fclose(fileptr);
  20.  
  21. int i;
  22. for(i = 0; i < filelen; i++) {
  23. if( i != 0 && i % 20 == 0 )
  24. printf("\n");
  25. printf("%c", buffer[i] ^ key[i%20]);
  26. }
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement