-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.inc
81 lines (75 loc) · 1.53 KB
/
init.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
_user_code _init
match,DEBUG
{
xor eax, eax
mov al, _SYSCALL_SHA1
int 030H
;xor eax, eax
;mov al, _SYSCALL_AESENC_ECB
;lea ebx, [esp-010H]
;mov dword [ebx], "HELO"
;mov ebx, _aes_test
;mov ecx, 010H
;mov edx, _aes_key
;int 030H
jmp $
_aes_test:
db 032H, 088H, 031H, 0E0H
db 043H, 05AH, 031H, 037H
db 0F6H, 030H, 098H, 007H
db 0A8H, 08DH, 0A2H, 034H
_aes_key:
db 02BH, 028H, 0ABH, 009H
db 07EH, 0AEH, 0F7H, 0CFH
db 015H, 0D2H, 015H, 04FH
db 016H, 0A6H, 088H, 03CH
}
xor eax, eax
mov al, _SYSCALL_FORK
int 030H
test eax, eax
jnz _init_parent
xor ecx, ecx
mov cl, _TELETYPE_COUNT
_init_parent_teletype:
mov eax, _SYSCALL_FORK
int 030H
test eax, eax
jnz _init_parent_loop
lea esi, [ecx-_TELETYPE_COUNT]
neg esi
mov eax, _SYSCALL_SSID
int 030H
mov dword [esp-4H], eax
mov eax, _SYSCALL_IOCTL
mov ebx, esi
mov ecx, TIOCSCTTY
xor edx, edx
int 030H
xor eax, eax
mov al, _SYSCALL_IOCTL
mov ebx, esi
mov ecx, TIOCSPGRP
lea edx, [esp-4H]
int 030H
mov eax, _SYSCALL_EXEC
mov ebx, _login_payload
mov ecx, _login.sizeof
int 030H
_init_parent_loop:
loop _init_parent_teletype
xor eax, eax
mov al, _SYSCALL_EXIT
xor ebx, ebx
int 030H
_init_parent:
xor eax, eax
mov al, _SYSCALL_WAITPID
mov ebx, _WAIT_ALL
xor ecx, ecx
xor edx, edx
mov dl, (WEXITED or WNOHANG)
int 030H
jmp _init_parent
_extract _login
end _user_code