Arregle un poco el coidigo ( lo que se puede arreglar estnado cansado ) , mañana si gustan lo termino de arreglar.
salu2
salu2
Código (asm) [Seleccionar]
proc GetAddressFunction,LibHandle,Api
locals
AddressOfNames dd ?
AddressOfFunctions dd ?
endl
push ebx edx edi ecx esi
mov eax,[LibHandle]
cmp eax,NULL
je .Error
mov ebx, dword[eax + 03Ch]
add ebx,eax
cmp word[ebx],"PE"
jne .Error
mov esi,dword[ebx+078h]
mov ebx,esi
add ebx,eax
push dword[ebx+20h]
pop [AddressOfNames]
add [AddressOfNames] ,eax
mov ecx,dword[ebx+018h]
mov edi,0
mov ebx,esi
add eax ,ebx
push dword[eax+1ch]
pop [AddressOfFunctions]
.encontrar:
dec ecx
mov eax, 0x4
mul edi
mov ebx,eax
add ebx,[AddressOfNames]
mov eax, [ebx]
add eax, [LibHandle]
inc edi
stdcall comparar, [Api], eax
cmp ecx,NULL
je .Error
cmp eax, 0
jne .encontrar
dec edi
rol edi,2
mov eax,edi
add eax, [AddressOfFunctions]
add eax,[LibHandle]
mov eax, dword[eax]
add eax,[LibHandle]
pop esi ecx edi edx ebx
ret
.Error:
xor eax,eax ; xor eax,eax = NULL
pop esi ecx edi edx ebx
ret
ret
endp
proc comparar ,SRC,DST
push edi ecx esi
stdcall Len,[SRC]
inc eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
proc Len , SRC
push ecx edi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp