flat assembler
Message board for the users of flat assembler.

Index > Windows > What include to use?

Author
Thread Post new topic Reply to topic
optiplex



Joined: 07 Mar 2008
Posts: 7
optiplex 10 Mar 2008, 13:22
Hello


Whats the best include to use?

When I include win32a.inc, then I have to import some functions manually

On win32ax.inc, some functions are already imported, like MessageBox//ExitProcess etc. But how do I import more functions, from a library like msvcrt.

I tried various things like

Code:
.idata
library msvcrt, 'msvcrt.dll'
import msvcrt,\
  exit, 'exit',\
  printf, 'printf'
    


but it gives me an 'already defined' error.

Any suggestions?

Thanks in advance

-optiplex
Code:
    

_________________
-optiplex-
Post 10 Mar 2008, 13:22
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 10 Mar 2008, 13:25
it's not dos.
Post 10 Mar 2008, 13:25
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 10 Mar 2008, 13:29
If you want to get imports from msvcrt then you have to use win32a.inc.

The win32ax version will automatically import the Win32 API's when you use ".end", so when you try to import msvcrt you have a conflict.
Post 10 Mar 2008, 13:29
View user's profile Send private message Visit poster's website Reply with quote
optiplex



Joined: 07 Mar 2008
Posts: 7
optiplex 10 Mar 2008, 15:40
Thanks revolution.

But what if I want to use msvcrlt AND the librarys that win32ax.inc loads?

Do I still have to load them manually with win32a.inc, or is there something else?

- optiplex
Post 10 Mar 2008, 15:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 10 Mar 2008, 15:54
With the current macros you need to do the imports yourself if you want to add extra libraries. Just copy the library section from win32ax and add the extra msvcrt and paste into your code.
Post 10 Mar 2008, 15:54
View user's profile Send private message Visit poster's website Reply with quote
optiplex



Joined: 07 Mar 2008
Posts: 7
optiplex 11 Mar 2008, 17:58
I tried to revolution, but it wont work

macro .end label
{
entry label
Code:
   section '.idata' import data readable writeable
     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'

     import_kernel32
     import_user32
     import_gdi32
     import_advapi32
     import_comctl32
     import_comdlg32
     import_shell32
     import_wsock32

     all_api
    

}

Just wont work Sad
Code:
    


It gives errors, like on import_kernel32.. etc

-optiplex
Post 11 Mar 2008, 17:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 12 Mar 2008, 00:29
Try to follow one of the examples included in the Windows download. The beer example shows how to include arbitrary libraries.
Post 12 Mar 2008, 00:29
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.