Skip to content

Instantly share code, notes, and snippets.

@blaquee
Created October 19, 2015 15:50
Show Gist options
  • Select an option

  • Save blaquee/484a7dddf05735e2d001 to your computer and use it in GitHub Desktop.

Select an option

Save blaquee/484a7dddf05735e2d001 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <sys/ptrace.h>
void anti_trace(void) __attribute__ ((constructor));
void anti_trace(void)
{
printf("checking for signs of alien life...\n");
if(ptrace(PTRACE_TRACEME, 0, 0, 0) < 0)
{
printf("Aliens found!\n");
exit(0);
}
}
void message()
{
printf("Execution success!\n");
}
int main()
{
message();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment