Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I execute a *.dll file [closed]

Tags:

windows

dll

People also ask

How do I reopen a DLL file?

Go to File and click Open and choose the dll that you want to decompile, After you have opend it, it will appear in the tree view, Go to Tools and click Generate Files(Crtl+Shift+G), select the output directory and select appropriate settings as your wish, Click generate files.

Can you execute DLL?

You can execute any of the functions exported by a DLL, assuming you know which one you want to execute; an EXE may contain a whole lot of functions, but one and only one is specially designated to be executed simply by "running" it.

How do I run a DLL file in Windows 10?

dll file in a Windows 10 64 bit, you may check with the steps listed below and see if it works: Go to the Search window and type cmd, right click on Command Prompt and choose Run as an administrator option. Type the following command in the command window and hit Enter - regsvr32 <dllname>


To run the functions in a DLL, first find out what those functions are using any PE (Portable Executable) analysis program (e.g. Dependency Walker). Then use RUNDLL32.EXE with this syntax:

 RUNDLL32.EXE <dllname>,<entrypoint> <optional arguments>

dllname is the path and name of your dll file, entrypoint is the function name, and optional arguments are the function arguments


You can execute a function defined in a DLL file by using the rundll command. You can explore the functions available by using Dependency Walker.


While many people have pointed out that you can't execute dlls directly and should use rundll32.exe to execute exported functions instead, here is a screenshot of an actual dll file running just like an executable:

enter image description here

While you cannot run dll files directly, I suspect it is possible to run them from another process using a WinAPI function CreateProcess:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx


DLLs are shared libraries which are used by other windows programs while EXEs are the files which are actually executed and are linked to DLL files so that they can use DLLs.
Both are of same format, PE(portable executable or format of machine code in windows in simple words).
In other words EXEs contain the entry point(main) and the DLLs contain the library functions.. You cannot execute a file which just contains library functions you can just use them via other programs.

But still there are programs like rundll32.exe which provides that entry point and some minimal framework required by DLL functions to be called.
The point that I want to make is, you can never execute a DLL file you can just use it's code by providing an entry point through an EXE or some other program.