flat assembler
Message board for the users of flat assembler.

Index > Windows > Export procedures from dll without macros

Author
Thread Post new topic Reply to topic
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 17 Aug 2005, 17:51
Can anybody write pure export code? Thanks for answer Smile.

_________________
...
Post 17 Aug 2005, 17:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8207
Location: Kraków, Poland
Tomasz Grysztar 17 Aug 2005, 17:57
Post 17 Aug 2005, 17:57
View user's profile Send private message Visit poster's website Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 18 Aug 2005, 08:21
Eh.. I was searching and I couldn't find this Smile. Thanks.
Post 18 Aug 2005, 08:21
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 18 Aug 2005, 22:42
hey, i suggest downloading some of the old fasm versions with the link provided in said thread it is http://fasm.sourceforge.net/archive/

from like 1.04+ (i think?) it has alot of hardcoded windows examples, including export, procedures, even some resource stuff, i know it helped me alot!
Post 18 Aug 2005, 22:42
View user's profile Send private message AIM Address MSN Messenger Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 18 Aug 2005, 23:20
All right, every thing ok, but I can't "export two procedures" from example dll. I have this code in export section (and the application cannot find the ShowLastError):
Code:
  dd 0,0,0,rva dlldemo_name,1
  dd 1,1,rva addresses_table,rva names_table,rva hints_table

  addresses_table:
    dd rva ShowErrorMessage
    dd rva ShowLastError
  names_table:
    dd rva _ShowErrorMessage
    dd rva _ShowLastError
  hints_table:
    dw 0

  dlldemo_name db 'ERRORMSG.DLL',0

  _ShowErrorMessage db 'ShowErrorMessage', 0
  _ShowLastError db 'ShowLastError', 0    
Post 18 Aug 2005, 23:20
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8207
Location: Kraków, Poland
Tomasz Grysztar 19 Aug 2005, 09:42
The table called "hints" is in fact the table of ordinal numbers - indexes into the addresses table. Each item in table of ordinals corresponds to the item of the same index in the table of names.
Thus your export should look like:
Code:
  dd 0,0,0,rva dlldemo_name,1 
  dd 1,1,rva addresses_table,rva names_table,rva ordinals_table 

  addresses_table: 
    dd rva ShowErrorMessage ; index 0
    dd rva ShowLastError ; index 1
  names_table: 
    dd rva _ShowErrorMessage 
    dd rva _ShowLastError 
  ordinals_table: 
    dw 0 
    dw 1

  dlldemo_name db 'ERRORMSG.DLL',0 

  _ShowErrorMessage db 'ShowErrorMessage', 0 
  _ShowLastError db 'ShowLastError', 0    

(and remember that table of names has to sorted alphabetically)
Post 19 Aug 2005, 09:42
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-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.