I have this Masm code but i want to use it in Tasm:
error2 db "Error",0
wpmerror db "Break found on WriteProcessMemory !",0
kernel db "kernel32.dll", 0
wpm db "WriteProcessMemory",0

invoke GetModuleHandle,ADDR kernel
invoke GetProcAddress, eax, ADDR wpm
cmp byte ptr ,0cch
jz breakfound

breakfound:
invoke MessageBox,0,addr wpmerror,addr error2,MB_OK
invoke ExitProcess,0

Does anyone think this translating is wrong:

Call GetModuleHandle,0
Push offset kernel
Call GetProcAddress, eax
Push offset wpm
Cmp eax,0cch
Jz @breakfound

@breakfound proc
push 0
push offset error2
push offset wpmerror
push _hwind
call messageboxa
call Exitprocess,0
ret
@breakfound endp

Thansk for any reply.
Posted on 2002-08-18 05:14:48 by sabertooth
replace all occurences of 'invoke' by 'call' (no need to manually push the values) and 'addr' by 'offset' and you should be fine.
Posted on 2002-08-18 06:20:46 by Tola
I don't know TASM but I dont think you can jump to a proc but you'll have
to call it. Actually I believe this is common for most assemblers.
Why don't you just run the code ?
Posted on 2002-08-18 06:21:18 by goofee
Thanks for the reply.
Posted on 2002-08-18 07:20:02 by sabertooth
no need to manually push the values (tola)
************************************
why?

shouldn't I push the parameters before calling the function?
Posted on 2002-08-18 07:46:41 by code1101
replace all occurences of 'invoke' by 'call' (tola)
*************************************

Do you only read half of the sentence ???????? :tongue:
Posted on 2002-08-18 07:57:03 by goofee
goofee ...
aren't we supposed to push the parameters when using call insted of invoke?
Posted on 2002-08-18 11:09:08 by code1101

goofee ...
aren't we supposed to push the parameters when using call insted of invoke?

when using tasm? no. :)
Posted on 2002-08-18 11:28:44 by Tola
code1101,
I didn't know either but it sounded like Tola knew what he was talking about :grin:
Posted on 2002-08-18 11:32:10 by goofee