示例#1
0
 def createFields(self):
     yield UInt32(self, "last_block")
     yield UInt32(self, "count")
     if self['last_block'].value != 0:
         for i in xrange(self['count'].value):
             block = UInt32(self, "child_block[]")
             yield block
             link = Link(self, "child_link[]")
             link.createValue = self.linkValue(block)
             yield link
             yield DSRecord(self, "record[]")
         link = Link(self, "child_link[]")
         link.createValue = self.linkValue(self['last_block'])
         yield link
     else:
         for i in xrange(self['count'].value):
             yield DSRecord(self, "record[]")
     if self.current_size < self.size:
         yield PaddingBytes(self, "slack", (self.size - self.current_size) // 8, description="slack space")
示例#2
0
 def createFields(self):
     yield UInt32(self, "last_block")
     yield UInt32(self, "count")
     if self['last_block'].value != 0:
         for i in xrange(self['count'].value):
             block = UInt32(self, "child_block[]")
             yield block
             link = Link(self, "child_link[]")
             link.createValue = self.linkValue(block)
             yield link
             yield DSRecord(self, "record[]")
         link = Link(self, "child_link[]")
         link.createValue = self.linkValue(self['last_block'])
         yield link
     else:
         for i in xrange(self['count'].value):
             yield DSRecord(self, "record[]")
     if self.current_size < self.size:
         yield PaddingBytes(self,
                            "slack", (self.size - self.current_size) // 8,
                            description="slack space")
示例#3
0
文件: fat.py 项目: jcao1022/hachoir
 def createValue(self):
     field = InodeGen(self["/"], self.parent, self._getTargetPath())(self)
     if field:
         self._display = field.path
         return Link.createValue(self)
示例#4
0
文件: fat.py 项目: jcao1022/hachoir
 def __init__(self, parent, name, target=None):
     Link.__init__(self, parent, name)
     self.target = target
     self.first = None