A healthy dose of sillyness
[retty.git] / arch / detach-ia32-linux.S
blobbe401c49dee61e2eb8bd91cfeba31b22bb6dde4f
1 /* This is bytecode inserted on the stack of the attached application. */
2 /* When you modify it, check that the length is dword-aligned. */
5 /*
6  * Ghvn-buri-Ghvn squatted down and touched the earth with his horny brow
7  * in token of farewell. Then he got up as if to depart. But suddenly he stood
8  * looking up like some startled woodland animal snuffling a strange air.
9  * A light came in his eyes.
10  *
11  * 'Wind is changing!' he cried, and with that, in a twinkling as it seemed,
12  * he and his fellows had vanished into the glooms, never to be seen by any
13  * Rider of Rohan again.
14  */
17         .equ    SYS_close,      6
18         .equ    SYS_getpid,     20
19         .equ    SYS_kill,       37
20         .equ    SYS_ioctl,      54
21         .equ    SYS_dup2,       63
23         .equ    TCGETS,         0x5401
24         .equ    TCSETS,         0x5402
26         .equ    SIGWINCH,       28
28         .equ    sizeof_termios, 60
30         .file   "detach.S"
31         .text
32 detach:
33         nop
34         nop
35         nop
36         nop
37         nop
38         nop
39         nop
40         nop
41         nop
42         nop
43         nop
44         nop
45         nop
46         nop
47         nop
48         nop
50         pusha
51         push    %ebp
52         mov     %esp, %ebp
53         sub     $sizeof_termios, %esp
56         mov     $SYS_close, %eax
57 zelena:
58         mov     $0x0, %ebx
59         int     $0x80
61         mov     $SYS_close, %eax
62 cervena:
63         mov     $0x1, %ebx
64         int     $0x80
66         mov     $SYS_close, %eax
67 vyblita:
68         mov     $0x2, %ebx
69         int     $0x80
72         mov     $SYS_dup2, %eax
73         mov     0x2c(%ebp), %ebx
74 modra:
75         mov     $0x0, %ecx
76         int     $0x80
78         mov     $SYS_dup2, %eax
79         mov     0x28(%ebp), %ebx
80 smoulova:
81         mov     $0x1, %ecx
82         int     $0x80
84         mov     $SYS_dup2, %eax
85         mov     0x24(%ebp), %ebx
86 hneda:
87         mov     $0x2, %ecx
88         int     $0x80
91         mov     $SYS_close, %eax
92         mov     0x2c(%ebp), %ebx
93         int     $0x80
95         mov     $SYS_close, %eax
96         mov     0x28(%ebp), %ebx
97         int     $0x80
99         mov     $SYS_close, %eax
100         mov     0x24(%ebp), %ebx
101         int     $0x80
104         mov     $SYS_getpid, %eax
105         int     $0x80
107         mov     %eax, %ebx
108         mov     $SYS_kill, %eax
109         mov     $SIGWINCH, %ecx
110         int     $0x80
112         leave
113         popa
115         /* The value will be rewritten */
116         add     $0x12000000, %esp
118         ret