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
|
...
d2str PROTO d:DWORD, bufferaddr:DWORD
...
.code
d2str PROC USES edi edx, d:DWORD, bufferaddr:DWORD
mov edi, bufferaddr
mov edx, 4 ; register length 4 bytes
.repeat
dec edx
mov eax, d
and eax, 0fh
mov al, hex[eax]
mov [edi+1], al
shr d, 4
mov eax, d
and eax, 0fh
mov al, hex[eax]
mov [edi], al
shr d, 4
add edi, 2
.until edx==0
mov byte ptr [edi], 0 ; null terminating string
ret
d2str ENDP
start:
push offset StringToHash
call lstrlen
invoke MD5, offset hash, eax, offset StringToHash
invoke d2str, hash, offset BUF_1
invoke d2str, hash+4, offset BUF_1+8
invoke d2str, hash+8, offset BUF_1+16
invoke d2str, hash+12, offset BUF_1+24
push 0
push offset StringToHash
push offset BUF_1
push 0
call MessageBox
... |
Partager