flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
I assume you actually want to use LEA instead of MOVSX.
Code: lea eax, [Text] ;and the same for the other movsx |
|||
![]() |
|
rinart73
Can you explain the difference, please?
UPD: This isn't works. _memcpy won't change variable Text :/ |
|||
![]() |
|
revolution
You are putting the arguments for memcpy in the wrong place. You can use the macro cinvoke to do the work for you.
Code: cinvoke _memcpy,Text,addr Text2,9 |
|||
![]() |
|
rinart73
I don't understand. Why ebp is the wrong place? I found it in tutorials.
And I tried to use "push" and proc _memcpy, arg1,arg2,arg3... cinvoke is fast? What is the difference from "invoke" and "call"? |
|||
![]() |
|
revolution
Your parameters need to follow ESP not EBP.
invoke is a macro, call is a CPU instruction. cinvoke (ccall convention) and invoke (stdcall convention) only differ in the way the stack is restored when the procedure returns. cinvoke will place the "add esp,12", but invoke won't. This is because of the stdcall and ccall convention differences. |
|||
![]() |
|
rinart73
cinvoke _memcpy, Text, addr Text2, 9
Error: invalid value : pushd addr ..var?TK cinvoke _memcpy, Text, dword[Text2], 9 Error: operand size not specified: call[_memcpy] |
|||
![]() |
|
revolution
Oh, sorry, your _memcpy is not the MSVCRT version. In that case use "stdcall _memcpy,...".
Also, don't put the ! in front of the names, it has no meaning unless you define your variable names with the ! also. |
|||
![]() |
|
rinart73
I use it for reason, believe me
![]() stdcall _memcpy, !Text, dword[!Text2], 9 Result: Crash |
|||
![]() |
|
rinart73
I use it for reason, believe me
![]() stdcall _memcpy, Text, dword[Text2], 9 Result: Crash |
|||
![]() |
|
revolution
Use "addr" not "dword":
Code: stdcall _memcpy, Text, addr Text2, 9 |
|||
![]() |
|
rinart73
all is working
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.