hi all,
i have loaded a dll with ctypes.cdll and i want to get thta dll's parameters and method
like when you write:
<'the dll handle'>.
and just after you put the dot a list appears to show you the methods
or like when you get a dir() from a class or like that
how to find out the dll's unctions and methods and ....???

by the way when i get dir() from the handle of cypes.cdll... i get this:
>>> from ctypes import *
>>> a=cdll.LoadLibrary('bssdk.dll')
>>> dir(a)

Me looking for the same. Someone please help

from DLL's documentation. I have never been able to see them via dir()
maybe another one have!

If you want to find out about the methods in a DLL you
can use the pefile module available at http://code.google.com/p/pefile/
Here is some sample code:

import os, pefile

dll = 'C:\Windows\system32\comdlg32.dll'
pe = pefile.PE(dll)
"""
pefile module can be downloaded at:
http://code.google.com/p/pefile/
"""
print "DLL IMPORT Reading (DLL dependencies) for: " + os.path.basename(dll)
for entry in pe.DIRECTORY_ENTRY_IMPORT:
  print entry.dll
  for imp in entry.imports:
    print '\t', hex(imp.address), imp.name

print "DLL EXPORT Reading:" + os.path.basename(dll)
for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols:
  print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address), exp.name, exp.ordinal

# pe.dump_info()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.