flat assembler
Message board for the users of flat assembler.

Index > Main > How get address tab dll functions ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1724
Roman 09 Jun 2024, 13:24
Fasmw 1.73
How do this ?
Code:
SECTION '.idata' IMPORT DATA READABLE WRITEABLE

     library  kernel32, 'KERNEL32.DLL',\
              user32,   'USER32.DLL',\              
              mydll,   'MSVCRT.DLL'

 include 'fasmAPI\kernel32.inc'
 include 'fasmAPI\user32.inc'
tabmydll:
 include 'mydll.inc'  ;i want set in code begin address tab all dll functions. 
    

include 'mydll.inc' have five functions.

In main code i want do:
mov eax,tabmydll ;how i get this ? Simple label ?
call [eax+8]
Post 09 Jun 2024, 13:24
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 795
Location: Russian Federation, Sochi
ProMiNick 09 Jun 2024, 18:32
Roman, thou mean mydll.lookup & mydll.address
mov eax,mydll.address
call [eax+8]
Post 09 Jun 2024, 18:32
View user's profile Send private message Send e-mail Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1724
Roman 10 Jun 2024, 07:56
mydll.lookup or mydll.address or tabmydll, I get the same address.
Post 10 Jun 2024, 07:56
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1724
Roman 10 Jun 2024, 08:00
Second question: How to make fasm get all five function addresses ? Not only using functions in code.

I remember fasm store only using functions in main code. Not all.
Post 10 Jun 2024, 08:00
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 795
Location: Russian Federation, Sochi
ProMiNick 10 Jun 2024, 20:39
Not only used functions? - in orginal library they all listed: thou could walk throw its export section.
LoadLibrary
add offset DOS_HEEADER.newexeheader
add offset of export section in PE stucture
strore result in register or variable
above shoud be called once

call (multyple times) as
mov eax,variable
call [eax+8]

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 10 Jun 2024, 20:39
View user's profile Send private message Send e-mail Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 921
Location: Russia
macomics 11 Jun 2024, 05:15
Roman wrote:
Second question: How to make fasm get all five function addresses ? Not only using functions in code.
Code:
macro usename [names] { common virtual
    forward jmp names
    common end virtual
}
usename function1name, function2name, function3name, function4name, function5name    
Post 11 Jun 2024, 05:15
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1724
Roman 11 Jun 2024, 07:01
Usename whear is write this macro?
In code or in data or in section import library?

And why needed Jmp in usename? Its for section code?
Post 11 Jun 2024, 07:01
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 921
Location: Russia
macomics 11 Jun 2024, 07:38
Roman wrote:
Usename whear is write this macro?
Anywhere before using usename
Roman wrote:
And why needed Jmp in usename? Its for section code?
Anywhere after the macro is declared. But not in virtual block
Post 11 Jun 2024, 07: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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.