Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <asm/kdebug.h>
- #include <linux/smp.h>
- #include <linux/sched.h>
- #include <linux/kallsyms.h>
- #include <asm/ptrace.h>
- #include <asm/asm-offsets.h>
- #include <asm/current.h>
- unsigned int ds;
- //struct pt_regs;
- module_param(ds,int,0);
- static int __init root_init(void)
- {
- //struct pt_regs own;
- struct pt_regs *ptr,p;
- ptr=&p;
- __asm__ ("mov $1,%%eax"
- :"=r"(ds)
- :
- );
- //__asm__("mov %fs,%rax");
- //asm ("mov %r13,%eax");
- printk("DS:%5x",ds);
- printk(KERN_INFO "addr %lx",(long unsigned int)&(ptr->r13)); //point to current task_struct (in root privilige)
- //printk(KERN_INFO "addr %d",FRAME_SIZE);
- return 0;
- }
- static void __exit root_cleanup(void)
- {
- }
- module_init(root_init);
- module_exit(root_cleanup);
- ===============================================================
- DS: 0
- addr ffff88003756be78
Advertisement
Add Comment
Please, Sign In to add comment