Slide 30
Slide 30 text
February 6, 2015 Mobile Central Europe
25
26
27
28
29
30
31
32
33
34
35
36
Bypassing ptrace tricks
static int (*orig_ptrace)(int request, pid_t pid, caddr_t addr, int data);!
!
int hooked_ptrace(int request, pid_t pid, caddr_t addr, int data) {!
int retVal;!
if (request == PT_DENY_ATTACH || request == PT_TRACEME) {!
return 0;!
}!
else {!
retVal = orig_ptrace(request, pid, addr, data);!
}!
return retVal;!
}!
MSHookFunction(MSFindSymbol(0, "ptrace"),hooked_ptrace,(void **)&orig_ptrace);!
ptrace(PT_DENY_ATTACH, 0, 0, 0);