rendered paste bodyimport 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 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'))