Created
September 5, 2018 00:50
-
-
Save aaronyoo/4b8bcb667c3581b7430a51533cd6444b to your computer and use it in GitHub Desktop.
A simple ptrace-trick example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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