Author Topic: Dll function caller  (Read 355 times)

Vortex

  • Member
  • *****
  • Posts: 2716
Dll function caller
« on: August 16, 2022, 05:28:27 AM »
Here is a small tool to call functions exported by Dlls. To pass numerical arguments, use a leading @ symbol. The environment variable %ERRORLEVEL% stores the value returned by the function called with CallDllFunc.exe :

Usage :

Code: [Select]
CallDllFunc.exe dllfile.dll function params
A quick example :

Code: [Select]
Set MB_ICONEXCLAMATION=48

Set MessageBox=MessageBoxA

CallDllFunc.exe msvcrt.dll printf "This is %%s %%u" test @1

CallDllFunc.exe user32.dll %MessageBox% @0 "Message 1" Caption @%MB_ICONEXCLAMATION%

CallDllFunc.exe testdll.dll add @80 @20

CallDllFunc.exe msvcrt.dll printf " 80 + 20 = %%u" @%ERRORLEVEL%

@echo.

quarantined

  • Guest
Re: Dll function caller
« Reply #1 on: August 16, 2022, 06:22:30 AM »
What would this be used for that is better than simply calling the exported function itself?


Vortex

  • Member
  • *****
  • Posts: 2716
Re: Dll function caller
« Reply #2 on: August 16, 2022, 06:33:06 AM »
Hi swordfish,

CallDllFunc is more functional than the similar Windows component rundll32. My tool can be used for batch file programming.

quarantined

  • Guest
Re: Dll function caller
« Reply #3 on: August 16, 2022, 06:36:20 AM »
Ah, ok. Since there was only a sparse description I was curious as to its usage. Thank you Vortex.

Greenhorn

  • Member
  • ***
  • Posts: 434
Re: Dll function caller
« Reply #4 on: August 16, 2022, 08:03:16 AM »
This is a nice one. Small and very useful.  :thumbsup:

Thanks, Erol !
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.

Biterider

  • Member
  • *****
  • Posts: 1043
  • ObjAsm Developer
    • ObjAsm
Re: Dll function caller
« Reply #5 on: August 16, 2022, 03:18:05 PM »
Hi Vortex
Nice Swiss Army knife  :thumbsup:

Biterider

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9988
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Dll function caller
« Reply #6 on: August 16, 2022, 05:01:48 PM »
Nice work Erol.  :thumbsup:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • *****
  • Posts: 1223
Re: Dll function caller
« Reply #7 on: August 16, 2022, 06:19:07 PM »
Useful tool for those, who don't want use vbs.
MessageBox with buttons can used to make choices.
May the source be with you