-
Notifications
You must be signed in to change notification settings - Fork 0
/
showpid.inc
53 lines (51 loc) · 964 Bytes
/
showpid.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
_user_code _showpid
xor eax, eax
mov al, _SYSCALL_WRITE
mov ebx, _TELETYPE_CURRENT
mov ecx, _parent_pid
mov edx, _parent_pid.sizeof
int 030H
xor eax, eax
mov al, _SYSCALL_GPPID
int 030H
call _vdso_itoa
mov edx, ecx
mov ecx, ebx
mov ebx, _TELETYPE_CURRENT
xor eax, eax
mov al, _SYSCALL_WRITE
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ecx, _newline
xor edx, edx
inc dl
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ecx, _process_pid
mov edx, _process_pid.sizeof
int 030H
xor eax, eax
mov al, _SYSCALL_GPID
int 030H
call _vdso_itoa
mov edx, ecx
mov ecx, ebx
mov ebx, _TELETYPE_CURRENT
xor eax, eax
mov al, _SYSCALL_WRITE
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ecx, _newline
xor edx, edx
inc dl
int 030H
xor eax, eax
mov al, _SYSCALL_EXIT
int 030H
_process_pid string "Process pid: "
_parent_pid string "Parent pid: "
_newline string 00AH
end _user_code