简体   繁体   中英

Need An alternative to RUNDLL32 for calling DLLs

I want to call a Windows DLL's exports by command line or by means of a batch file. The DLL is winscard.dll , which is located at \\windows\\system32 .

But I don't want to use RUNDLL or RUNDLL32, because the functions I want to call, don't have the standard signature to call by RUNDLL32.

The signature has to be like:

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

So I am looking for a different way to call those functions. Has anybody done this before?

Try this: http://pastebin.com/U8XvZsvA (in case the link is not working: https://paste.ee/p/clnzM )

Compile with GCC.

Use it like this rundll winscard.dll EntryPoint [arguments in order from left to right] .

To pass a string argument, prefix it with a . , otherwise it will be taken as a numeric value (as recognised by strtol ).

Of course it will most probably not work if the function takes pointer arguments, which you cannot pass from command line. You can edit the code to suit your needs, but it's likely that what you want to do will not be possible to do from a batch file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM