All pastes #763199 Raw Edit

Mine

public python v1 · immutable
·published 2007-11-06 07:56 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[2]class XBECert(Struct):	__endian__ = Struct.LE	def __format__(self):		self.certSize, self.timestamp, self.titleID = Struct.uint32[3]		self.titleName = Struct.string(0x50)		self.altTitleIDs = Struct.uint32[16]		self.media, self.region, self.rating = Struct.uint32[3]		self.diskNumber, self.version = Struct.uint32[2]		self.LANKey, self.sigKey = Struct.string(16)[2]		self.altSigKeys = Struct.string(16)[16]class XBE(object):	def __init__(self, fp):		data = fp.read()				header = XBEHeader(data)		assert header.magic == 'XBEH'				cert = XBECert(data, header.certAddr - header.base)				print cert.titleName.decode('utf-16')if __name__=='__main__':	XBE(file(sys.argv[1], 'rb'))