Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ^@352203363
- 00ea 83f3
- #include <stdio.h>
- #include <unistd.h>
- #include <fcntl.h>
- int main(int ac, char **av)
- {
- int fd;
- char tmp[4];
- if ((fd = open(av[1], O_RDONLY)) == -1)
- {
- printf("Open failed.n");
- return (-1);
- }
- if ((read(fd, tmp, 4)) == -1)
- {
- printf("Read failed.n");
- return (-1);
- }
- printf("%s", tmp); /* Here I don't know really what to do to print. */
- if ((close(fd)) == -1)
- {
- printf("Close failed.n");
- return (-1);
- }
- return (0);
- }
- printf("%02x %02x %02x %02x", tmp[0], tmp[1], tmp[2], tmp[3]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement