[Wisp-cvs] wisp/users/dig pedump.py,NONE,1.1
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-14 22:38:33
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12981 Added Files: pedump.py Log Message: introduced pedump.py --- NEW FILE: pedump.py --- #! /usr/bin/python #### pedump.py - parse PE data structures # # Copyleft © 2003 by Andres Soolo (di...@us...) # This file is licensed under the GNU GPL v2. If you # don't know what that means, please do read the GPL. # #### @(#) $Id: pedump.py,v 1.1 2003/04/14 22:38:29 digg Exp $ from __future__ import nested_scopes import sys import struct from bindump import * from elf import * args = sys.argv[1:] if args: for filename in args: f = open(filename, 'r') mz_magic, bytes_in_last_block, blocks_in_file = \ struct.unpack('<HHH', f.read(6)) print 'MZ magic: %04x' % mz_magic print 'Bytes in last block: %04x' % bytes_in_last_block print 'Blocks in file: %04x' % blocks_in_file else: print 'Usage: pedump.py file ...' |