import sys
import os


class DisassHEADERS:
	header = []
	table = []
	
	def __init__(self,filename):
		self.init(os.popen('objdump -p %s'%(filename)).readlines())
		self.init(os.popen('objdump -h %s'%(filename)).readlines())
		self.init(os.popen('objdump -a %s'%(filename)).readlines())
	
	def __str__(self):
		return "".join(self.table)
		
	def init(self,lines):
		self.header = lines[0:4]
		self.table = lines[4:]
		
	def printTXT(self,outfile=sys.stdout):
		print >>outfile,("\n\nHEADERS:")
		for line in self.table:
			print >>outfile,(line.strip())
