- Assembly code
_ReplaceChar proc uses ecx eax esi edi ebx lpSrcStr,SrcSize,FromChar,ToChar LOCAL @ResultStr[sizeof lpSrcStr]:byte LOCAL @szBuffer[1024]:byte pushad invoke RtlZeroMemory,addr @ResultStr,sizeof @ResultStr mov ecx,SrcSize mov esi,lpSrcStr lea edi,@ResultStr xor ebx,ebx_start: ;invoke wsprintf,addr @szBuffer,offset szFormatNumber,FromChar,ToChar,SrcSize,ebx,lpSrcStr,addr @ResultStr ;invoke MessageBox,NULL,addr @szBuffer,addr @ResultStr,MB_OK cmp ebx,SrcSize je _return lodsb cmp eax,FromChar je _replace stosb inc ebx jmp _start_replace: mov eax,ToChar stosb inc ebx jmp _start _return: lea eax,@ResultStr popad ret_ReplaceChar endp
------解决方案--------------------------------------------------------
同志, 用peter-bochs吧
------解决方案--------------------------------------------------------
lpSrcStr,SrcSize,FromChar,ToChar 需要写上类型吧