Código: Seleccionar todo
include 'E:\ASM\FASMP\INCLUDE\win32ax.inc'
.code
start:
stdcall hStrcmp,"Indetectables.net","Indetectables.com.ar"
cmp ecx,0
jne diferentes
je iguales
iguales:
invoke MessageBox,0,"¡Son iguales!",0,0
invoke ExitProcess,0
diferentes:
invoke MessageBox,0,"¡Son diferentes!",0,0
invoke ExitProcess,0
.end start
proc hStrcmp,cCadenaA,CadenaB
; Usage hStrcmp,'Hi friend','Hi friend2' /// RETURN VALUE = ECX
xor ecx,ecx
xor eax,eax
xor ebx,ebx
compstr:
mov eax,[cCadenaA] ; Save First String
mov ebx,[CadenaB] ; Save Second String
mov al, byte[eax]
mov bl, byte[ebx]
cmp al,0 ; if = 0 exit func
JE endstr ; if = 0 exit func
cmp bl,0
je endstr
cmp al,bl
jne failedstr
inc [cCadenaA]
inc [CadenaB]
jmp compstr
failedstr:
mov ecx,-1
push ecx
ret
endstr:
mov ecx,0
push ecx
ret
endp