All pastes #763176 Raw Edit

Mine

public python v1 · immutable
·published 2007-11-06 07:06 UTC
rendered paste body
import syssys.path.append('..\\..')from PyStand import Structclass XBEHeader(Struct):	__endian__ = Struct.LE	def __format__(self):		self.magic = Struct.string(4)		self.sig = Struct.string(0x100)		self.base, self.headerSize, self.imageSize = Struct.uint32 * 3		self.imageHeaderSize, self.timestamp = Struct.uint32 * 2		self.certAddr, self.numSects, self.sectHeaders = Struct.uint32 * 3		self.flags, self.entry, self.tls = Struct.uint32 * 3		self.stackCommit, self.heapReserve, self.heapCommit = Struct.uint32 * 3		self.baseAddress, self.peImageSize = Struct.uint32 * 2		self.peChecksum, self.peTimestamp = Struct.uint32 * 2		self.pathName, self.fileName, self.uniFileName = Struct.uint32 * 3		self.thunkAddr, self.nonKernel = Struct.uint32 * 2		self.numLibraryVers, self.libraryVers = Struct.uint32 * 2		self.kernelLibraryVers, self.xapiLibraryVers = Struct.uint32 * 2		self.logoBitmapAddr, self.logoBitmapSize = Struct.uint32 * 2class XBE(object):	def __init__(self, fp):		data = fp.read()				header = XBEHeader(data)		print header.magic		assert header.magic == 'XBEH'if __name__=='__main__':	XBE(file(sys.argv[1], 'rb'))