1

Why was RunDLL and later RunDLL32 conceived? What is the purpose of their existence? So as to bypass the task manager?

https://support.microsoft.com/en-us/kb/164787

The article states that RunDLL still requires a particular method header for a candidate entry point:

16-bit DLL:

  void FAR PASCAL __loadds
  EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);

32-bit DLL:

  void CALLBACK
  EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);

What is the purpose of using a RunDLL entry point rather than a main entry point as in a regular executable file?

MathuSum Mut
  • 2,765
  • 3
  • 27
  • 59
  • The whole point is being able to run a DLL without a matching EXE to go with it. – Carey Gregory Jan 22 '16 at 15:36
  • Why not rename the assembly to *.exe? There is no need to have a matching .exe file. – MathuSum Mut Jan 22 '16 at 15:37
  • Huh? You can't just rename a DLL and have it act as an application. – Carey Gregory Jan 22 '16 at 15:37
  • If it has a main entry point then yes. – MathuSum Mut Jan 22 '16 at 15:38
  • A DLL is a **library**, not an application. The whole purpose of DLLs is to serve as a collection of functions that can be used by multiple applications. If you give it a `main` entry point then you no longer have a **library**. – Carey Gregory Jan 22 '16 at 15:39
  • But if you have a RunDLL calling an entry point, it loses the whole purpose of being a DLL. – MathuSum Mut Jan 22 '16 at 15:39
  • No, it does not. I suggest you read up on DLLs a little more. – Carey Gregory Jan 22 '16 at 15:40
  • What do you suggest I learn about DLLs? – MathuSum Mut Jan 22 '16 at 15:40
  • http://stackoverflow.com/questions/31237323/call-function-from-executable – MathuSum Mut Jan 22 '16 at 15:41
  • Their purpose and use. You seem to be confusing them with applications. `RunDLL` was created simply as a tool to allow you to execute functions within a DLL without the need for writing an application to load and call them. – Carey Gregory Jan 22 '16 at 15:42
  • Ok, the reason seems to be that functions within .exe files are hard to address from outside, I see your point now. – MathuSum Mut Jan 22 '16 at 15:45
  • 1
    Note that [the use of rundll32 is discouraged.](https://blogs.msdn.microsoft.com/oldnewthing/20130104-00/?p=5643) Basically it comes to us from Windows 95, and the only reason it still exists is inertia and backwards compatibility. Even in Windows 95 rundll32 may have only existed because of inertia from 16-bit Windows. And as for why rundll existed in 16-bit Windows, it avoided needing a whole bunch of separate executables. In that age, every byte counted. – Harry Johnston Jan 22 '16 at 23:24

0 Answers0