mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-29 22:04:33 +00:00
While here, make it easier to extend by providing macros to eliminate the mundane that goes into writing getset members.
20 lines
570 B
Python
Executable File
20 lines
570 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import time
|
|
import pepy
|
|
|
|
p = pepy.parse(sys.argv[1])
|
|
ep = p.get_entry_point()
|
|
byts = p.get_bytes(ep, 8)
|
|
print "Signature: %s" % hex(p.signature)
|
|
print "Machine: %s" % hex(p.machine)
|
|
print "Number of sections: %s" % p.numberofsections
|
|
print "Number of symbols: %s" % p.numberofsymbols
|
|
print "Characteristics: %s" % hex(p.characteristics)
|
|
print "Timedatestamp: %s" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(p.timedatestamp))
|
|
print "Bytes at 0x%x: %s" % (ep, byts)
|
|
print "Sections:"
|
|
for sect in p.get_sections():
|
|
print(sect)
|