Hi,
I need to use 'call' instead of 'invoke'.
How can I convert the following snippet to push the address of '_st' ?
Thanks for your help.
flyingtiger
init proc
local _st:SYSTEMTIME
local temp:dword
invoke GetSystemTime,addr _st
...
I need to use 'call' instead of 'invoke'.
How can I convert the following snippet to push the address of '_st' ?
Thanks for your help.
flyingtiger
init proc
local _st:SYSTEMTIME
local temp:dword
invoke GetSystemTime,addr _st
...
If it wasn't a local you could do:
Now you have to:
Haha Mirno, beat you :)
init proc
local _st:SYSTEMTIME
local temp:dword
push offset _st
call GetSystemTime
Now you have to:
init proc
local _st:SYSTEMTIME
local temp:dword
lea eax,_st
push eax
call GetSystemTime
Haha Mirno, beat you :)
If its a global struct "push offset whatever" - because the assembler can determine the address at assemble time.
If its local "lea eax, whatever" followed by "push eax" - because the address is not known, but is relative to ebp, so this will assemble to "lea eax, "
Mirno
If its local "lea eax, whatever" followed by "push eax" - because the address is not known, but is relative to ebp, so this will assemble to "lea eax, "
Mirno
Hi Qweerdy, Mirno,
Thanks to both of you for your help.
Where can I learn all about these neat tricks (local, global, struct...) ?
flyingtiger.
Thanks to both of you for your help.
Where can I learn all about these neat tricks (local, global, struct...) ?
flyingtiger.
Reading other people's source, mostly. It's all in \masm32\help\masm32.hlp too, though. May be a bit much too read all of it, but it's a good reference.
In fact, when you open it and click the topmost link ("Using invoke"), you'll see "addr" and "offset" explained right there :)
In fact, when you open it and click the topmost link ("Using invoke"), you'll see "addr" and "offset" explained right there :)
Maybe try the MASM documentation, though i forgot the site. But i can post it online.
Please post the url.
Thanks,
flyingtiger
Thanks,
flyingtiger