flat assembler
Message board for the users of flat assembler.

Index > Windows > Winmm.inc for beginner

Author
Thread Post new topic Reply to topic
Traxler



Joined: 30 Oct 2014
Posts: 12
Traxler
'Hello world'

someone gave winmm.inc but impossible to use with winax.inc

For example,

include 'x:\fasm\include\win32ax.inc'
include 'x:\fasm\include\api\winmm.inc'

.code
start:
invoke MessageBox,0,'something','something',MB_OK
invoke mciSendString 'open cdaudio',0,0,0
invoke ExitProcess,0
.end start

Fasm told me undenied symbol mciSendString ?

Can you help me ?
Advance thanks
Post 15 Nov 2014, 10:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
You will need to have the winmm imports put into the .end macro. Just make a new .end macro modified as shown below.
Code:
;...
     library kernel32,'KERNEL32.DLL',\
             user32,'USER32.DLL',\
             gdi32,'GDI32.DLL',\
             advapi32,'ADVAPI32.DLL',\
             comctl32,'COMCTL32.DLL',\
             comdlg32,'COMDLG32.DLL',\
             shell32,'SHELL32.DLL',\
             wsock32,'WSOCK32.DLL'
----> add your winmm DLL link here

     import_kernel32
     import_user32
     import_gdi32
     import_advapi32
     import_comctl32
     import_comdlg32
     import_shell32
     import_wsock32
----> add your minmm imports here

;...    
Post 15 Nov 2014, 11:02
View user's profile Send private message Visit poster's website Reply with quote
Traxler



Joined: 30 Oct 2014
Posts: 12
Traxler
revolution wrote:
You will need to have the winmm imports put into the .end macro. Just make a new .end macro modified as shown below.
Code:
;...
     library kernel32,'KERNEL32.DLL',\
             user32,'USER32.DLL',\
             gdi32,'GDI32.DLL',\
             advapi32,'ADVAPI32.DLL',\
             comctl32,'COMCTL32.DLL',\
             comdlg32,'COMDLG32.DLL',\
             shell32,'SHELL32.DLL',\
             wsock32,'WSOCK32.DLL'
----> add your winmm DLL link here

     import_kernel32
     import_user32
     import_gdi32
     import_advapi32
     import_comctl32
     import_comdlg32
     import_shell32
     import_wsock32
----> add your minmm imports here

;...    


Fasm says now : illegal instruction import_winmm ...
Post 15 Nov 2014, 11:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
If you haven't defined the macro 'import_winmm' then you can manually place the imports:
Code:
import winmm32,\ ;<--- use the same name you used for the library
       mciSendStringA,'mciSendStringA',\
       mciSendStringW,'mciSendStringW'
;...    
Note the A and W versions for most Windows APIs that have text strings. You can also just put "mciSendString,'mciSendStringA'" if you only want to support ASCII.
Post 15 Nov 2014, 12:10
View user's profile Send private message Visit poster's website Reply with quote
Traxler



Joined: 30 Oct 2014
Posts: 12
Traxler
revolution wrote:
If you haven't defined the macro 'import_winmm' then you can manually place the imports:
Code:
import winmm32,\ ;<--- use the same name you used for the library
       mciSendStringA,'mciSendStringA',\
       mciSendStringW,'mciSendStringW'
;...    
Note the A and W versions for most Windows APIs that have text strings. You can also just put "mciSendString,'mciSendStringA'" if you only want to support ASCII.


Still have the same error message...
Post 15 Nov 2014, 12:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
Show your code please.
Post 15 Nov 2014, 13:14
View user's profile Send private message Visit poster's website Reply with quote
Traxler



Joined: 30 Oct 2014
Posts: 12
Traxler
revolution wrote:
Show your code please.


All is ok, thank very much for your help
Post 15 Nov 2014, 14:38
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.