Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list exported functions from dll with ctypes

Is there any way to know which functions are exported from the dll through python foreign function library ctypes?

And if possible to know details about the exported functions through ctypes.

If yes, could someone provide a snippet of code?

like image 517
Tom Avatar asked May 23 '10 11:05

Tom


People also ask

How do I view a DLL exported function?

These functions are the entry points into the DLL; only the functions in the exports table can be accessed by other executables. Any other functions in the DLL are private to the DLL. The exports table of a DLL can be viewed by using the DUMPBIN tool with the /EXPORTS option.

How do I get a list of functions in a DLL?

You can list function names for a specific DLL, such as user32. dll, by running a variety of command-line tools. For example, you can use dumpbin /exports user32. dll or link /dump /exports user32.

What is a Ctype?

ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python.


1 Answers

I don't think ctypes offers this functionality. On Windows with visual studio:

DUMPBIN -EXPORTS XXX.DLL 

Or for mingw on windows:

objdump -p XXX.dll 
like image 64
Mark Avatar answered Oct 02 '22 11:10

Mark