main.lv
Dont think code it

2010-2-23 Linux antidebug 1

Date: 2010-02-23 19:18:03

Content: When ptrace is used for programm debugin then only
one ptrace can be attached to programmwhen we trying run ptrace
with PTRACE_TRACEME then we get  -1. I tested with gdb,ald.
Also this method should work with IDApro
#include <stdlib.h>
#include <stdio.h>
#include <sys/ptrace.h>

long int ptraced()
{
	return (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1);
}

int main()
{
	if ( ptraced() )
	{
		printf("Ptraced!\n");
	}
	return 0;
}

Downloads