Sometimes I've tried to attach Ollydbg to applications those have some protection against debuggers, but I have never coded any of these applications and did not see this protection in many applications... So it looks like it is not hard to bypass this, however I am curious and never tried it before. How do you do it guys? (at least some examples on some simple program).
Thanks in advance.
ptrace
can only be done with a test which will be localized in the code. And, I am not sure that attaching to a running software will cause a0xcc
to be written (does it?). So, self-check routine to detect modification of the source code will fail as wel.. My guess is that you just need to be lucky when you attach you debugger to the program and to stop it in a safe mode.