Skip to content

Instantly share code, notes, and snippets.

@aaronyoo
Created September 5, 2018 00:50
Show Gist options
  • Save aaronyoo/4b8bcb667c3581b7430a51533cd6444b to your computer and use it in GitHub Desktop.
Save aaronyoo/4b8bcb667c3581b7430a51533cd6444b to your computer and use it in GitHub Desktop.
A simple ptrace-trick example
#include <stdio.h>
#include <sys/ptrace.h>
int main() {
if (ptrace(PTRACE_TRACEME, 0, 1, 0) == -1) {
printf("Debugger\n");
} else {
printf("Normal\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment