/* compile: gcc -DMODULE -D__KERNEL__ -c this.c */

/* no ptrace module
   fast prevention for kenrel bug
   (c) 2001 a Lam3rZ odyssey
*/ 


#include <linux/module.h>
#include <linux/unistd.h> 
#include <sys/syscall.h>

#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
#include <asm/unistd.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,14)
#include <bits/syscall.h>
#endif
   
extern void *sys_call_table[];
   
int (*orig_ptrace)(int, int, int, int);

int no_ptrace (int request, int pid, int addr, int data)
{return -1;}


int init_module(void) {   

        orig_ptrace = sys_call_table[__NR_ptrace];
        sys_call_table[__NR_ptrace]=no_ptrace;
        return 0;
}

void cleanup_module(void) {

        sys_call_table[__NR_ptrace]=orig_ptrace;
}
