Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing Contents Of a DLL File

Tags:

python

c

c#

import

dll

is this possible to view contents and Functions of a DLL file...
few times ago i was playing with OlyDBG then i found there is option for viewing contents of dll...
so suggest me any good tool or soft for this...

and suppose i have a DLL named "Python27.dll"...
now i need to view the content of this DLL so what do i do...
thanx...

like image 958
vs4vijay Avatar asked Jan 21 '23 15:01

vs4vijay


1 Answers

While not trivial to use (you need to understand the format of a Portable Executable, aka PE, file), pefile seems a good, powerful and versatile tool for the purpose of viewing a DLL or any other PE file (I wouldn't risk using it to change such a file, although I see it's one of its features).

For example, excerpting the module's usage examples (and editing to show a dll instead of the equally hypothetical filename they use, which is an exe;-):

import pefile
pe =  pefile.PE(‘/path/to/pefile.dll’)
for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols:
  print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address), exp.name, exp.ordinal

should, according to the wikipage I pointed to, display something like:

0x7ca0ab4f SHUpdateRecycleBinIcon 336
0x7cab44c0 SHValidateUNC 173
0x7ca7b0aa SheChangeDirA 337
0x7ca7b665 SheChangeDirExA 338
0x7ca7b3e1 SheChangeDirExW 339
0x7ca7aec6 SheChangeDirW 340
0x7ca8baae SheConvertPathW 341
like image 56
Alex Martelli Avatar answered Jan 24 '23 04:01

Alex Martelli