summaryrefslogtreecommitdiff
path: root/other/burneye/sat.diff
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /other/burneye/sat.diff
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'other/burneye/sat.diff')
-rw-r--r--other/burneye/sat.diff114
1 files changed, 114 insertions, 0 deletions
diff --git a/other/burneye/sat.diff b/other/burneye/sat.diff
new file mode 100644
index 0000000..4fa8099
--- /dev/null
+++ b/other/burneye/sat.diff
@@ -0,0 +1,114 @@
1diff -r -u burneye.old/src/stub/include/int80.h burneye/src/stub/include/int80.h
2--- burneye.old/src/stub/include/int80.h Thu Dec 13 22:36:21 2001
3+++ burneye/src/stub/include/int80.h Tue Jan 1 23:29:31 2002
4@@ -409,6 +409,29 @@
5 return (ret);
6 }
7
8+static inline int antistrace(void)
9+{
10+ long ret;
11+
12+ __asm__ __volatile__ ("int $0x03\n\t"
13+ :"=a" (ret)
14+ : );
15+ return (ret);
16+}
17+
18+#define SIGTRAP 5
19+
20+static inline int signal(int signum, void *handler)
21+{
22+ long ret;
23+
24+ __asm__ __volatile__ ("int $0x80"
25+ :"=a" (ret)
26+ :"0" (__NR_signal), "b" ((long)signum),
27+ "c" ((int)handler));
28+ return ret;
29+}
30+
31
32 #endif
33
34diff -r -u burneye.old/src/stub/stub.c burneye/src/stub/stub.c
35--- burneye.old/src/stub/stub.c Thu Dec 13 22:36:21 2001
36+++ burneye/src/stub/stub.c Tue Jan 1 23:40:36 2002
37@@ -37,6 +37,7 @@
38 int burneye (unsigned long int auxc, Elf32_auxv_t *auxv, char *envp[],
39 char *argv[], int argc);
40 void be_seal (unsigned char *shdr_p);
41+void be_sigtrap (int signum);
42
43 void be_auxv_reloc (unsigned long int auxc, Elf32_auxv_t *auxv);
44 void be_auxv_set (Elf32_auxv_t *auxv, unsigned int auxc,
45@@ -59,13 +60,31 @@
46 */
47 char ** env = NULL; /* environ */
48 char * progfile = NULL; /* this executeable as pathname */
49-
50+int nottraced = 0; /* will be > 0 if traced */
51
52 /* unlink stub encoded in a .h
53 */
54 #include "unlinkstub-bin.h"
55
56
57+static inline int killme()
58+{
59+ long ret;
60+
61+ __asm__ __volatile__ ("xorl %%eax, %%eax\t\n"
62+ "xorl %%ebx, %%ebx\t\n"
63+ "xorl %%ecx, %%ecx\t\n"
64+ "xorl %%edx, %%edx\t\n"
65+ "xorl %%esi, %%esi\t\n"
66+ "xorl %%edi, %%edi\t\n"
67+ "xorl %%ebp, %%ebp\t\n"
68+ "xorl %%esp, %%esp\t\n"
69+ "jmp %%esi"
70+ :"=a" (ret)
71+ : );
72+ return ret;
73+}
74+
75
76 char *
77 getenv (char *varname)
78@@ -145,6 +164,9 @@
79 be_printf ("WARNING: stub is running on its own, without"
80 "payload, is this what you want?\n");
81 }
82+
83+ /* setup signal handler */
84+ signal (SIGTRAP, be_sigtrap);
85
86 be_stubhdr = (stubhdr *) &be_stubhdr_u;
87 be_printf ("be_stubhdr = 0x%08lx\n", (unsigned long int) be_stubhdr);
88@@ -163,7 +185,13 @@
89 be_printf ("%lu auxiliary vectors @ 0x%08lx\n", auxc,
90 (unsigned long int) auxv);
91 be_printf ("brk @ 0x%08lx\n", brk(0));
92-
93+
94+ /* detect l/strace */
95+ antistrace();
96+
97+ if (!nottraced) {
98+ killme();
99+ }
100
101 /* points always to the actual element */
102 shdr_p = ((unsigned char *) be_stubhdr) + sizeof (stubhdr);
103@@ -422,6 +450,11 @@
104 return (this_entry);
105 }
106
107+void
108+be_sigtrap (int signum)
109+{
110+ nottraced++;
111+}
112
113 void
114 be_seal (unsigned char *shdr_p)