Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C

Driver to hide files in Linux OS

,
Rate me:
Please Sign up or sign in to vote.
4.44/5 (13 votes)
2 Sep 2012CPOL7 min read 44.3K   777   34  
Simple driver for Linux OS that performs hiding of the selected files from the system
#ifndef DEVICE_FILE_H_
#define DEVICE_FILE_H_
#include <linux/compiler.h> /* __must_check */
#include <linux/fs.h>
#ifndef BUF_LEN
#define BUF_LEN 256
#endif
__must_check int register_device(void); /* 0 if Ok*/
void unregister_device(void); 
int inode_hide_init(void);
void inode_hide_exit(void);
void allocate_memmory(void);
void reallocate_memmory(void);
unsigned long hook_functions(const char *);
unsigned long backup_functions(void);
int parent_readdir (struct file *, void *, filldir_t);
int new_readdir (struct file *, void *, filldir_t);
int new_open (struct inode *, struct file *);
int new_flush (struct file *, fl_owner_t id);
int new_release (struct inode *, struct file *);
int new_ioctl (struct inode *, struct file *, unsigned int, unsigned long);
int new_lock (struct file *, int, struct file_lock *);
int new_mmap (struct file *, struct vm_area_struct *);
ssize_t new_read (struct file *, char __user *, size_t, loff_t *);
ssize_t new_write (struct file *, const char __user *, size_t, loff_t *);
int new_getattr (struct vfsmount *mnt, struct dentry *, struct kstat *);
int new_rmdir (struct inode *,struct dentry *);

#endif //DEVICE_FILE_H_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer Apriorit Inc.
United States United States
ApriorIT is a software research and development company specializing in cybersecurity and data management technology engineering. We work for a broad range of clients from Fortune 500 technology leaders to small innovative startups building unique solutions.

As Apriorit offers integrated research&development services for the software projects in such areas as endpoint security, network security, data security, embedded Systems, and virtualization, we have strong kernel and driver development skills, huge system programming expertise, and are reals fans of research projects.

Our specialty is reverse engineering, we apply it for security testing and security-related projects.

A separate department of Apriorit works on large-scale business SaaS solutions, handling tasks from business analysis, data architecture design, and web development to performance optimization and DevOps.

Official site: https://www.apriorit.com
Clutch profile: https://clutch.co/profile/apriorit
This is a Organisation

33 members

Written By
Team Leader Apriorit
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions