-
Notifications
You must be signed in to change notification settings - Fork 0
/
md5.inc
63 lines (62 loc) · 1.38 KB
/
md5.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
_user_code _md5
xor eax, eax
mov al, _SYSCALL_ARGCPY
int 030H
mov ebp, dword [_USER_SHELL_ARGUMENT_VIRTUAL]
test ebp, ebp
jnz _md5_hash
xor eax, eax
mov al, _SYSCALL_WRITE
mov ebx, _TELETYPE_CURRENT
mov ecx, _md5_invalid
mov edx, (_md5_invalid.sizeof + 1H)
int 030H
mov ebx, (not 0H)
jmp _md5_exit
_md5_hash:
xor eax, eax
mov al, _SYSCALL_WRITE
mov ebx, _TELETYPE_CURRENT
mov ecx, _md5_head
mov edx, _md5_head.sizeof
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ecx, (_USER_SHELL_ARGUMENT_VIRTUAL + 4H)
mov edx, ebp
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ecx, _md5_tail
mov edx, _md5_tail.sizeof
int 030H
xor eax, eax
mov al, _SYSCALL_MD5
mov ebx, (_USER_SHELL_ARGUMENT_VIRTUAL + 4H)
mov ecx, ebp
lea edx, [esp-_MD5_DIGEST]
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ebx, _TELETYPE_CURRENT
lea ecx, [esp-_MD5_DIGEST]
mov edx, _MD5_DIGEST
int 030H
xor eax, eax
mov al, _SYSCALL_WRITE
mov ebx, _TELETYPE_CURRENT
mov ecx, _md5_newline
xor edx, edx
inc dl
int 030H
xor ebx, ebx
_md5_exit:
xor eax, eax
mov al, _SYSCALL_EXIT
int 030H
_md5_head string "md5("""
_md5_tail string """) = "
_md5_invalid string "md5 invalid usage"
_md5_newline: db 00AH
_md5.sizeof = ($ - $$)
end _user_code