flat assembler
Message board for the users of flat assembler.

Index > Windows > can't get with locals

Author
Thread Post new topic Reply to topic
pr0x



Joined: 31 Jan 2006
Posts: 2
pr0x
I have some proc, like thisone:
Code:
proc    gwd
locals
        szdir   rd      100h
endl
        lea             edx,[szdir]
        stdcall [GetSystemDirectory],edx,100h
        invoke  MessageBox,0,edx,edx,0 ;

        ret

endp
    

So I need it to show me path to systemdir. How can I do this?
if szdir is in .data segment, then all works fune (in MessageBox edx should be changed to szdir), but using locals..endl I can't. Please help.[/code]
Post 31 Jan 2006, 10:09
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
get OllyDbg (OllyDebug), and trace into procedure... debugging skill is as important as coding skill.
Post 31 Jan 2006, 10:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
chris



Joined: 05 Jan 2006
Posts: 62
Location: China->US->China->?
chris
you can not expect that GetSystemDirectory preserve edx.
and the rule of fasm is that symbols outside square brackets are labels(addresses). so you may try:

Code:
proc    gwd 
locals 
        szdir   rd      100h 
endl 
        lea             edx,[szdir] 
        stdcall [GetSystemDirectory],edx,100h

        lea             edx,[szdir] 
        invoke  MessageBox,0,edx,edx,0 ; 

        ret 

endp 
    


And actually there is a macro 'addr' in win32ax.inc that you could use in this case.
Post 31 Jan 2006, 10:33
View user's profile Send private message Reply with quote
pr0x



Joined: 31 Jan 2006
Posts: 2
pr0x
Thank's for advice!
Post 31 Jan 2006, 11:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.