summaryrefslogtreecommitdiff
path: root/crash
diff options
context:
space:
mode:
authorjvoisin2013-01-20 03:17:51 +0100
committerjvoisin2013-01-20 03:17:51 +0100
commitd97a964bca0296876491f382107e548048ffc821 (patch)
tree017d30406ef34fa5598d1ffb2d785ad6124d1b0d /crash
parent4bd7371e36d0e23c0514c134582db372f9b38402 (diff)
Crash with unexpected signals (fucktards only !)
Diffstat (limited to 'crash')
-rw-r--r--crash/signals.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/crash/signals.c b/crash/signals.c
new file mode 100644
index 0000000..3a8c143
--- /dev/null
+++ b/crash/signals.c
@@ -0,0 +1,24 @@
1#include <stdio.h>
2#include <signal.h>
3#include <unistd.h>
4
5void handler(int sig){
6 printf("No debugger, or passed signals\n");
7
8 //Put your code here
9
10 _exit(0);
11}
12
13int main(){
14 /*
15 * Not everyone is clever enough to
16 * think that a SIGEGV/SIGILL is rightful ;)
17 */
18
19 signal(SIGSEGV, handler);
20 __asm__("movl $1, %eax");
21
22 signal(SIGILL, handler);
23 __asm__("ud2");
24}