#include #include #include int main(int ac, char **av) { int fd = open(av[1], O_RDWR) ; char s[6] ; int i ; if (fd == -1) { perror("open()") ; return -1 ; } if (lseek(fd, 0x2131, 0) == -1) { perror("lseek()") ; return -1 ; } if (read(fd, s, sizeof(s)) != sizeof(s)) { perror("read()") ; return -1 ; } for (i = 0; i < sizeof(s); i ++) printf("%.2x ", (unsigned char)s[i]) ; printf("\n") ; if (lseek(fd, 0x2131, 0) == -1) { perror("lseek()") ; return -1 ; } if (write(fd, "\x90\x90\x90\x90\x90\x90", 6) != 6) { perror("write()") ; return -1 ; } return 0 ; }