We know that the Windows DLL is not able to run independently, but Microsoft has provided rundll32.exe for running DLLs.
Test first: Run "Rundll32.exe shell32.dll,restartdialog" and the restart dialog will pop up. The same way you can turn on other features of Windows systems.
Here's a look at how to define your own DLL to let Rundll32.exe run.
The DLL function prototypes given by Microsoft are as follows:
void CALLBACK
EntryPoint (HWND hwnd, HINSTANCE hinst, LPSTR lpszcmdline, int ncmdshow);
Hwnd-window handle that should is used as the owner window for any
windows your DLL creates
hinst-your dll ' s I Nstance handle
lpszcmdline-asciiz command line your DLL should parse
ncmdshow-describes how your DLL ' s windows should be displayed
The custom test DLLs are as follows:
extern "C" _declspec (dllexport) void __cdecl Rundll32dllfun (HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine,
int nCmdShow)
{
MessageBox (NULL, "TEST", LPSZCMDLINE,MB_OK);
Return
}
Generate Dynamic Library Rundll32dll.dll.
Run:
Rundll32.exe "E:\demo\rudll32dll\Release\rudll32dll.dll", Rundll32dllfun
A familiar dialog box pops up, stating that the call was successful.
You can also pass in parameters and run:
Rundll32.exe "E:\demo\rudll32dll\Release\rudll32dll.dll", Rundll32dllfun 888
The dialog box pops up, and 888 shows the dialog box, indicating that the parameters can also be passed, where the parameters are obtained in lpszCmdLine.
Run command description: rundll32.exe "Xxx.dll", dllfun parameter
So that we can develop the DLL as an application to run, only see the rundll32.exe in the process, you need to see through the Process View tool which DLL is running.
rundll32.exe where the location of the 4-bit system is explained:
Windows/system32/rundll32.exe calling a 64-bit DLL
Windows/syswow64/rundll32.exe calling a 32-bit DLL
Microsoft's reference article is as follows: http://support2.microsoft.com/kb/164787