Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ^@352203363
  2.  
  3. 00ea 83f3
  4.  
  5. #include <stdio.h>
  6. #include <unistd.h>
  7. #include <fcntl.h>
  8.  
  9. int main(int ac, char **av)
  10. {
  11. int fd;
  12. char tmp[4];
  13.  
  14. if ((fd = open(av[1], O_RDONLY)) == -1)
  15. {
  16. printf("Open failed.n");
  17. return (-1);
  18. }
  19. if ((read(fd, tmp, 4)) == -1)
  20. {
  21. printf("Read failed.n");
  22. return (-1);
  23. }
  24. printf("%s", tmp); /* Here I don't know really what to do to print. */
  25. if ((close(fd)) == -1)
  26. {
  27. printf("Close failed.n");
  28. return (-1);
  29. }
  30. return (0);
  31. }
  32.  
  33. printf("%02x %02x %02x %02x", tmp[0], tmp[1], tmp[2], tmp[3]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement