DllListExports() - List of Function exports of a DLL

Post your working scripts, libraries and tools
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

DllListExports() - List of Function exports of a DLL

13 Sep 2014, 21:25

DllListExports(). Rewrite of PE_FunctionExports()
- AutoHotkey 1.1 and 2.0
Usage example: MsgBox % DllListExports( "shell32.dll" )

Code: [Select all] [Expand] [Download] (DllListExports.ahk)GeSHi © Codebox Plus

jballi
Posts: 443
Joined: 29 Sep 2013, 17:34

Re: DllListExports() - List of Function exports of a DLL

13 Sep 2014, 21:47

Looks useful. :thumbup: Now if I could only remember to use it when I need it next...
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: DllListExports() - List of Function exports of a DLL

13 Sep 2014, 22:42

Hi jballi :)

I have this third party dll with 135 functions with decorated names like _my_function_d@24 whereas the documentation is for my_function().
So, this is the idea: Create a function that will load all functions names ( tinkered to match documentation ) along with the proc-address into an associative array... and within wrapper functions I can initialize them like Static MyDescriptiveFunction := MyDll( "My_Function" ). That will be too much code, maybe, but at least the main script will be easy to follow.

:)
jballi
Posts: 443
Joined: 29 Sep 2013, 17:34

Re: DllListExports() - List of Function exports of a DLL

13 Sep 2014, 23:40

Definitely out of my purview but it does look like one way to separate the real functions from the documented "front-end" functions. Yes, it does look like a lot of extra code.

I noticed that you joined this forum 36 minutes before I did. I was planning to join an hour earlier but I had to call my Mom. Yeah, that's what happened. :)

Thanks for the great function.
just me
Posts: 4800
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: DllListExports() - List of Function exports of a DLL

14 Sep 2014, 03:57

SKAN wrote:So, this is the idea: Create a function that will load all functions names ( tinkered to match documentation ) along with the proc-address into an associative array...
Bentschi published a function (without the tinkering part) in the old forum -> /board/topic/90266-funktionen-loadlibrary-freelibrary-schnellere-dllcalls/.
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: DllListExports() - List of Function exports of a DLL

14 Sep 2014, 10:29

just me wrote:Bentschi published a function (without the tinkering part) in the old forum -> /board/topic/90266-funktionen-loadlibrary-freelibrary-schnellere-dllcalls/.


Thanks just me, very useful info.. The code is broken though.

joedf wrote:http://aspdm.tk/#loadlibrary
aspdm://aspdm.tk/loadlibrary


Those links never worked for me. Any pointers to working code, please.
just me
Posts: 4800
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: DllListExports() - List of Function exports of a DLL

14 Sep 2014, 15:17

Well, that's my version, created because I tried to understand what Bentsch's script is actually doing, and working AFAIK.

Code: [Select all] [Expand] [Download] (LoadLibrary.ahk)GeSHi © Codebox Plus

Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: DllListExports() - List of Function exports of a DLL

14 Sep 2014, 16:33

Thank you just me... I tried it and works great!.. but I have already written my own version.
Locating IMAGE_EXPORT_DIRECTORY is very simple as I have demonstrated in DllListExports()

something like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



However, I wouldn't prefer calling GetProcAddress() umpteen times while Proc addresses are already available.

Code: [Select all] [Download] GeSHi © Codebox Plus

  DllObj := {Base: {__Delete: Func("FreeLibrary"), "&": HDLL}}                  ; & : HMODULE

Thanks. I think I will understand it. :?

Here is my code so far , adapted from DllListExports():

Code: [Select all] [Expand] [Download] (Demo_ListFuncsAndProcAddress.ahk)GeSHi © Codebox Plus

User avatar
joedf
Posts: 5945
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: DllListExports() - List of Function exports of a DLL

15 Sep 2014, 00:18

@SKAN looks like server is down... Some bozo DDoS my free hosting service :(
just me
Posts: 4800
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: DllListExports() - List of Function exports of a DLL

15 Sep 2014, 07:40

SKAN wrote:However, I wouldn't prefer calling GetProcAddress() umpteen times while Proc addresses are already available.

That's exactly the question I asked Bentschi. The answer was: Export Forwarding.
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: DllListExports() - List of Function exports of a DLL

15 Sep 2014, 11:19

just me wrote:Export Forwarding.


Thanks for the link. :)
Bookmarked!.
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: DllListExports() - List of Function exports of a DLL

15 Sep 2014, 11:20

joedf wrote:@SKAN looks like server is down... Some bozo DDoS my free hosting service :(

Free hosting service? I didn't know.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: desgen and 27 guests