Is it possible to find out what functions are available in an arbitrary dll file and then call these functions using C# interop services.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can analyze the exported functions of any native module (DLL or EXE) using tools such as dumpbin. Once you have the signatures of the exported functions, you can write P/Invoke wrappers for any of them you wish.
Alternatively, you can use a tool like the P/Invoke Interop Assistant to automagically do the grunt work for you.
However, all of that relies upon the native module having listed the functions you’re trying to call in its export table. If what you’re looking to hook into is not actually exported, then you will have to resort to old-fashioned spelunking with GetProcAddress, etc.