flat assembler
Message board for the users of flat assembler.

Index > Windows > regarding import library

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
any idea why if you use the following
Code:
section '.idata' import data readable writeable
        library kernel8932njskafds,     'KERNEL32.DLL',\
                ssadfdsas,      'USER32.DLL'
        include 'apia\Kernel32.inc'
        include 'apia\User32.inc'
    


the app would get assembled without throwing any error? (tested using latest fasm)
Post 09 Aug 2006, 21:44
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Why do you expect it to throw errors?
The label 'kernel8932njskafds' is only for yourself.

I am not sure if Privalov changed the import macros used inside apia\*.inc include files, but they could be automatically forcing library import table directives.
Post 09 Aug 2006, 22:38
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
yo comrade :p

btw, i suggest at least it notices users that something wrong there.

coz if u do something like below
Code:
section '.idata' import data readable writeable
        library user32, 'USER32.DLL'
        import  use32,\
                MessageBox,'MessageBoxA'
    


the app get asssembled but the app wouldn't perform as intended coz a typo in import use{r}32.

well, maybe somebody would spend several minutes?? Rolling Eyes Rolling Eyes to find that mistake. if a notice was given by assembler, then user can fix it in several seconds.
Post 09 Aug 2006, 22:55
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
Yep, I think import macro should warn if no library 'handle' used found...
with 'handle' I mean library <this>, 'humm'
Post 10 Aug 2006, 00:33
View user's profile Send private message MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Code:
macro library [name,string]
 { forward
    local _label
    if defined name#.redundant   ;<---------- HERE
     if ~ name#.redundant          ;<----------- HERE
      dd RVA name#.lookup,0,0,RVA _label,RVA name#.address
     end if
    end if
   common
    dd 0,0,0,0,0
   forward
    if defined name#.redundant  ;<------- HERE
     if ~ name#.redundant ;<--------- HERE
      _label db string,0
             rb RVA $ and 1
     end if
    end if }
    

it's for case, when you have library listed in your imports, but you aren't using anything from it, thus you aren't importing anything from it, thus import data is empty, which is probably bug under windoze.

Otherwise it would be annoying while starting project, you would either have to add things to import section 3-4 times, or fakele "use" some proc from library
Post 10 Aug 2006, 07:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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 GitHub, YouTube, Twitter.

Website powered by rwasa.