class Bitmap(Attribute): specific_layout = {} def __init__(self, parent, offset): Attribute.__init__(self, parent, offset) common_update_and_swap(self) if self.uchNonResFlag: self.decode() self.file = DatarunStream(self.dataruns, self.u64RealSize, self._parent._disk) else: #~ i = self._i + 24 + self.uchNameLength*2 i = self._i + self.wAttrOffset self.file = StringIO.StringIO(self._buf[i: i+self.dwLength].tostring()) logging.debug("resident $BITMAP @%x", i) __getattr__ = common_getattr def __str__ (self): return class2str(self, "$BITMAP @%x\n" % self._i) decode = common_dataruns_decode def isset(self, bit): byte = bit/8 bit = bit%8 self.file.seek(byte) b = self.file.read(1) return ord(b) & (1 << bit) != 0
def __init__(self, parent, offset): Attribute.__init__(self, parent, offset) common_update_and_swap(self) if self.uchNonResFlag: self.decode() self.file = DatarunStream(self.dataruns, self.u64RealSize, self._parent._disk) else: #~ i = self._i + 24 + self.uchNameLength*2 i = self._i + self.wAttrOffset self.file = StringIO.StringIO(self._buf[i: i+self.dwLength].tostring()) logging.debug("resident $BITMAP @%x", i)
def __init__(self, parent, offset): Attribute.__init__(self, parent, offset) common_update_and_swap(self) if self.uchNonResFlag: self.decode() # differire all'uso effettivo dello stream? self.file = DatarunStream(self.dataruns, self.u64RealSize, self._parent._disk) else: i = self._i + self.wAttrOffset self.file = StringIO.StringIO(self._buf[i: i+self.dwLength].tostring()) logging.debug("resident $DATA @%x", i)