The MASM Forum

Members Gallery => Showcase => Topic started by: Vortex on August 16, 2022, 05:28:27 AM

Title: Dll function caller
Post by: Vortex 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.
Title: Re: Dll function caller
Post by: quarantined on August 16, 2022, 06:22:30 AM
What would this be used for that is better than simply calling the exported function itself?

Title: Re: Dll function caller
Post by: Vortex 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.
Title: Re: Dll function caller
Post by: quarantined 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.
Title: Re: Dll function caller
Post by: Greenhorn on August 16, 2022, 08:03:16 AM
This is a nice one. Small and very useful.  :thumbsup:

Thanks, Erol !
Title: Re: Dll function caller
Post by: Biterider on August 16, 2022, 03:18:05 PM
Hi Vortex
Nice Swiss Army knife  :thumbsup:

Biterider
Title: Re: Dll function caller
Post by: hutch-- on August 16, 2022, 05:01:48 PM
Nice work Erol.  :thumbsup:
Title: Re: Dll function caller
Post by: TimoVJL 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.