flat assembler
Message board for the users of flat assembler.

Index > Windows > FASM doesn't compile a source...

Author
Thread Post new topic Reply to topic
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13 29 Oct 2007, 23:27
Please, help...
Why, doesn't FASM compile it?:

Code:
format PE GUI 4.0 DLL
entry DllMain

include '%fasminc%\win32a.inc'

struct MOUSEHOOKSTRUCT
        .pt             POINT
        .hwnd           dd ?
        .wHitTestCode   dd ?
        .dwExtraInfo    dd ?
ends

WMU_MOUSEHOOK equ WM_USER + 6

section '.data' data readable writeable
        insH            dd ?                    ;handle for instance

section '.sdata' readable writeable shareable
        hookH   dd ?
        wndH    dd ?

section '.code' code readable executable
   proc DllMain, hinstDll, fdwReason, lpvReserved
                push [hinstDll]
                pop  [insH]
                mov  eax,TRUE
                ret
   endp
        
   proc mouse_procedure,nCode,wParam,lParam
        invoke  CallNextHookEx,[hookH],[nCode],[wParam],[lParam]
                mov  edx,[lParam]
        invoke  WindowFromPoint,[edx + MOUSEHOOKSTRUCT.pt.x],[edx + MOUSEHOOKSTRUCT.pt.y]
        invoke  PostMessage,[wndH],WMU_MOUSEHOOK,eax,0
                xor  eax,eax            ;must clear eax here
                ret
   endp
   
   proc mouse_hook_install,wndTempH
                push [wndTempH]
                pop  [wndH]
        invoke  SetWindowsHookEx,WH_MOUSE,mouse_procedure,[insH],NULL
                mov  [hookH],eax
                ret
   endp

   proc mouse_hook_uninstall
        invoke  UnhookWindowsHookEx,[hookH]
                ret
   endp

section '.idata' import data readable
        library USER32, 'USER32.DLL'

        import  USER32,\
                CallNextHookEx,         'CallNextHookEx',\
                WindowFromPoint,        'WindowFromPoint',\
                PostMessage,            'PostMessageA',\
                SetWindowsHookEx,       'SetWindowsHookExA',\
                UnhookWindowsHookEx,    'UnhookWindowsHookEx'

section '.edata' export data readable
        export  'TUT_24A.DLL',\
                mouse_procedure,        'mouse_procedure',\
                mouse_hook_install,     'mouse_hook_install',\
                mouse_hook_uninstall,   'mouse_hook_uninstall'

section '.reloc' fixups data discardable    


FASM writes 'undefined symbol...' Embarassed

_________________
FASM Rulezzzzzz!
Post 29 Oct 2007, 23:27
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 29 Oct 2007, 23:36
Code:
        invoke  WindowFromPoint,[edx + MOUSEHOOKSTRUCT..pt.x],[edx + MOUSEHOOKSTRUCT..pt.y]     


I suppose that you don't really want your fields names started with a dot so remove them since struct macro does not need them like struc preprocessor directive does.
Post 29 Oct 2007, 23:36
View user's profile Send private message Reply with quote
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13 29 Oct 2007, 23:40
Oh... really:) Thanks!
It's not my source, but a fasm source from one book...
Post 29 Oct 2007, 23:40
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 29 Oct 2007, 23:52
Is there a fasm book? Please provide some info about it because I didn't know of the existance of one.
Post 29 Oct 2007, 23:52
View user's profile Send private message Reply with quote
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13 11 Nov 2007, 21:29
M... These are ICZELION's MASM tutirials converted to FASM Wink
Yes, of course:)
The link is http://prikolitvc.ucoz.ru/sulaiman.rar
Post 11 Nov 2007, 21:29
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 11 Nov 2007, 23:02
Aaah, tutorials, yes I knew those, the author is sleepsleep of this forum. Those tutorials was written long time ago and probably is using old win32 headers.
Post 11 Nov 2007, 23:02
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.