problem in hacking sys_call_table
I have a problem in tracking the sys_exit function. I am able to install the below
module successfully but not able to intercept the syscalls. Can anyone point out the problem in the below code. void * hack_sys_call_table[] ; asmlinkage int (*original_sys_exit)(int errorcode); asmlinkage int our_fake_exit_function(int error_code) { /** process and then call original sys exit *******/ } int init_module() { *(long *) &hack_sys_call_table = (long) 0xc032f974; /**** c032f974 is the address of sys_call_table obtained from System.Map ****/ original_sys_exit=hack_sys_call_table[__NR_exit]; hack_sys_call_table[__NR_exit]=our_fake_exit_function; return 0; } |
*(long *) &hack_sys_call_table = (long) 0xc032f974;
uhh, no. |
All times are GMT -5. The time now is 01:05 PM. |