flat assembler
Message board for the users of flat assembler.

Index > Windows > Give a little help !

Author
Thread Post new topic Reply to topic
Xanfa



Joined: 03 Aug 2006
Posts: 29
Xanfa 03 Aug 2006, 02:16
Hi everybody, i'm a newbie in assembler in windows, and have a little problem .
Anyone know something like this in Masm32:

assume edx: PTR MOUSEHOOKSTRUCT
invoke WindowFromPoint,[edx].pt.x,[edx].pt.y

How does it look in Fasm ?
I think I can code:

invoke WindowFromPoint,[edx],[edx+4]

but it isn't nice, is it ?

Please help, Thankx alot !
Post 03 Aug 2006, 02:16
View user's profile Send private message Yahoo Messenger Reply with quote
Xanfa



Joined: 03 Aug 2006
Posts: 29
Xanfa 03 Aug 2006, 02:49
Hmm! I've just read about an undocumented macro, "assume" !
And maybe it's what i'm expect.
But I still need all your idea, thanks !
Post 03 Aug 2006, 02:49
View user's profile Send private message Yahoo Messenger Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 03 Aug 2006, 04:07
Xanfa,

Tomasz Grysztar posted these suggestions:

After loading the address of your structure into ebx,

Quote:
virtual at ebx
SomeAtEbx SomeStruct ; define instance at EBX address
end virtual

and then:
Code:
mov eax,[SomeAtEbx.Var2] ; assembles to mov eax,[ebx+4]


If you prefer to have the offsets only, you can do it like:
Code:
virtual at 0
SomeStruct SomeStruct ; define instance with the same name
end virtual

and then:
Code:
mov eax,[ebx+SomeStruct.Var2]

(this is what "struct" macro does internally). Choose the one you like more.


In your example you used edx, you would change the above references to ebx to edx!

hth,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 03 Aug 2006, 04:07
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 03 Aug 2006, 22:38
The 'struct' macro by default sets all constants. You reference them via [...+NAME_OF_STRUCTURE.StructureMember] eg.:
Code:
invoke WindowFromPoint,[edx + POINT.x],[edx + POINT.y]    
Post 03 Aug 2006, 22:38
View user's profile Send private message Visit poster's website Reply with quote
Xanfa



Joined: 03 Aug 2006
Posts: 29
Xanfa 04 Aug 2006, 01:37
Oh, your way is simple, and all is done from Tomasz tutorial about win32 headers !
I've already read about struct macro, but I'm so stupid to missed it !

farrier and Reverend - Thanks alot !
Post 04 Aug 2006, 01:37
View user's profile Send private message Yahoo Messenger 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.