mikorians,
You procedure code is not accessing the parameters correctly. I used the printf macro to display the addresses and strings because I don’t have much time to do this. The important part is not the macro calls but what they are displaying.
;===================================================================================
include \masm32\include\masm32rt.inc
;===================================================================================
.data
MyStr db "This. is my. test .text.",0
repFind db ".",0
repString2 db "-",0
.code
;===================================================================================
;-----------------------------------------------------------------------
; Added "p" prefix to indicate that the string parameters are pointers.
;-----------------------------------------------------------------------
ReplaceSt proc RepStart:DWORD, pRepString1:DWORD, pRepFind:DWORD, pRepString2:DWORD
lea ebx, pRepFind
printf("LEA pRepFind : %Xh\n", ebx)
mov ebx, pRepFind
printf("MOV pRepFind : %Xh\n\n", ebx)
lea ebx, pRepString2
printf("LEA pRepString2 : %Xh\n", ebx)
mov ebx, pRepString2
printf("MOV pRepString2 : %Xh\n\n", ebx)
mov ebx, pRepString1
printf("%s\n", ebx)
mov ebx,pRepFind
printf("%s\n", ebx)
mov eax,pRepString2
printf("%s\n\n", eax)
ret
ReplaceSt endp
;===================================================================================
start:
;===================================================================================
printf("Address of repFind : %Xh\n", OFFSET repFind)
printf("Address of repString2 : %Xh\n\n", OFFSET repString2)
invoke ReplaceSt, 1, Addr MyStr, Addr repFind, Addr repString2
inkey
exit
;================================================================================
END start