Advertisement
opexxx

pe-export.py

Jun 13th, 2014
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import pefile
  5. import argparse
  6.  
  7. if __name__ == "__main__":
  8.     parser = argparse.ArgumentParser(description='List exported function of a PE.')
  9.     parser.add_argument('filename', metavar='filename', type=str,
  10.                                                help='the DLL to use')
  11.     args = parser.parse_args()
  12.     filename = args.filename
  13.     pe = pefile.PE(filename)
  14.     for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols:
  15.           print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address),\
  16.             exp.name, exp.ordinal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement