android内核系统调用表钩子
我正在使用android 4.2.2Jelly和linux内核3.0.31源代码。我试图钩住开放系统调用,但我不知道如何在给定地址的情况下将页面从只读更改为可写,因为sys\u call\u表是只读的。 我已经在linux Ubuntu12.04 3.2.32上通过下面的lookup_address函数成功地实现了这一点android内核系统调用表钩子,android,kernel-module,system-calls,Android,Kernel Module,System Calls,我正在使用android 4.2.2Jelly和linux内核3.0.31源代码。我试图钩住开放系统调用,但我不知道如何在给定地址的情况下将页面从只读更改为可写,因为sys\u call\u表是只读的。 我已经在linux Ubuntu12.04 3.2.32上通过下面的lookup_address函数成功地实现了这一点 int make_rw(unsigned long address) { unsigned int level; pte_t *pte
int make_rw(unsigned long address)
{
unsigned int level;
pte_t *pte = lookup_address(address, &level);
if(pte->pte &~ _PAGE_RW)
pte->pte |= _PAGE_RW;
return 0;
}
但不幸的是,这个函数是针对x86而不是针对arm的。我不知道如何在臂弓上做
另一种方法:基于写保护寄存器
#define CR0_WP 0x10000 //Write Protect Bit (CR0:16)
unsigned long cr0;
cr0 = read_cr0();
write_cr0(cr0 & ~CR0_WP);/* remove write protection*/
hookfunc(){...};
write_cr0(cr0);/* set write protection*/
但我不知道臂弓的相对位置
有人解决了这个问题吗?在线等待答案