Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

#ifdef DEBUG

    //do nothing
#else

    ptrace(PT_DENY_ATTACH, 0, 0, 0);
#endif

I really have a hard time taking advice on copy protection from someone who doesn't known about ifndef.

Furthermore, PT_DENY_ATTACH won't help because any cracker worth is salt will just open the binary with an hex editor and remove the call to ptrace(). The other two tips to prevent cracking are, at best, as useless as this one.

And just in case you're wondering, those three methods are equally useless on iOS.



To avoid having to modify the binary (and thus deal with checksums and the like), you can alternatively break on ptrace where the first arg == PT_DENY_ATTACH, then have it immediately return. Easy to do in GDB.


This is useless: task_for_pid() still works, and there's many public kernel extensions out there that just remove this feature entirely.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: