Search code examples
c++windowsdllfunction-pointers

How to call function from DLL with only function name ? C++


It's possible to call a function from a DLL file without knowing about function prototype ? I try to extract all exported function from a DLL file using pe-parser library, But i only have the function name and i don't know about function input/output. Is there any solution to find exported function input/output from dll files ? or call functions without knowing about function prototype ?


Solution

  • TL;DR - No.

    In order to call the function properly, you need to know the function prototype. It is usually provided in an h file that ships with the DLL.

    You can try to reverse-engineer the DLL in order to figure out the prototype but this information is not a part of the PE file.

    If you have a PDB file you can extract the relevant information from it. See this answer.