Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #define HDIO_DRIVE_TASK 0x031e
- #define HDIO_DRIVE_CMD 0x031f
- int main(int argc, char* argv[]) {
- int fd = open(argv[1], O_RDWR);
- unsigned char args[7] = { 0xef, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 };
- if (ioctl(fd, HDIO_DRIVE_TASK, args)) {
- printf("error\n");
- } else {
- printf("okay\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement