2

For example:

rundll32.exe "test.dll",#1

I looked into rundll32.exe manual

But I can not find the meaning of the sharp(#).

Athafoud
  • 2,898
  • 3
  • 40
  • 58
Bgsong
  • 21
  • 1
  • 2
  • 1
    You'd normally provide the *name* of the function in test.dll that you want to run. By using #, you tell it that you don't want to specify the name but the number of the exported function. First one in this case. Using the name is of course best, less accidents that way. – Hans Passant Jan 13 '16 at 12:46
  • @HansPassant You don't always have a choice. Functions can be exported by ordinal only. – nobody Jan 13 '16 at 13:33
  • 1
    @AndrewMedico Then fix your DLL to export it by name. Exporting by ordinals means that rundll32 cannot determine what character set your function expects to receive (because rundll32 infers that from whether the function name ends in A or W). – Raymond Chen Jan 13 '16 at 15:39

1 Answers1

5

Using the sharp sign instead of a function name in the parameters to rundll32.exe is used for calling an exported function by its Ordinal instead of its name.

Please see https://msdn.microsoft.com/en-us/library/aa264882(v=vs.60).aspx for more information.

Megabeets
  • 1,378
  • 11
  • 19
J. jojo
  • 51
  • 1
  • 3