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
| ;===========================
;MD5
;Test vector:
;"abc" 900150983cd24fb0d6963f7d28e17f72
;===========================
.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
StringToHash db "abc",0
DLLname db "md.dll",0
FuncName db "MD5",0
lpMD dd 0
BUF_1 db 100 dup (0)
.data?
hDLL dd ?
.code
start:
invoke LoadLibrary,offset DLLname
mov hDLL,eax
invoke GetProcAddress, hDLL, offset FuncName
mov lpMD,eax
push offset StringToHash
call lstrlen
push offset StringToHash
push eax
push offset BUF_1
call lpMD
push 0
push offset StringToHash
push offset BUF_1
push 0
call MessageBox
invoke FreeLibrary,hDLL
push 0
call ExitProcess
end start |
Partager